def test_3d(self): self.assertEqual( slice_shape(self[::2], (3, 3, 3)), ( 2, 3, 3, ), )
def test_single(self): self.assertEqual(slice_shape(self[3], (5, )), (1, ))
def test_backward(self): self.assertEqual(slice_shape(self[4:3:-1], (5, )), (1, ))
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, ))
def test_empty(self): self.assertEqual(slice_shape(self[4:3], (5, )), (0, ))