Example #1
0
 def test_3d(self):
     self.assertEqual(
         slice_shape(self[::2], (3, 3, 3)),
         (
             2,
             3,
             3,
         ),
     )
Example #2
0
 def test_single(self):
     self.assertEqual(slice_shape(self[3], (5, )), (1, ))
Example #3
0
 def test_backward(self):
     self.assertEqual(slice_shape(self[4:3:-1], (5, )), (1, ))
Example #4
0
 def test_step(self):
     self.assertEqual(slice_shape(self[1:3:2], (5, )), (1, ))
     self.assertEqual(slice_shape(self[1:4:2], (5, )), (2, ))
     self.assertEqual(slice_shape(self[4:1:-3], (5, )), (1, ))
Example #5
0
 def test_empty(self):
     self.assertEqual(slice_shape(self[4:3], (5, )), (0, ))