add test for slice_one

This commit is contained in:
George Hotz
2022-07-03 12:14:20 -07:00
parent d10dd175f4
commit 93c378dffc

View File

@@ -148,6 +148,9 @@ class TestOps(unittest.TestCase):
helper_test_op([(3,3,3,3)], lambda x: x[1:2, 1:2], lambda x: x[1:2, 1:2])
helper_test_op([(3,3,3,3)], lambda x: x[1:2, 1:2, 0:-1], lambda x: x[1:2, 1:2, 0:-1])
def test_slice_one(self):
helper_test_op([(3)], lambda x: x[1], lambda x: x[1])
def test_pad2d(self):
helper_test_op([(3,3,3,3)], lambda x: torch.nn.functional.pad(x, (1,2,3,4)), lambda x: x.pad2d(padding=(1,2,3,4)))