remove unnecessary 'argfix' because 'view' is an alias to 'reshape'. all functionality must be inside 'reshape' (#10677)

* remove unnecessary 'argfix' because 'view' is an alias to 'reshape'. all functionality must be inside 'reshape'

* added the same set of unit tests for 'view' as for 'reshape' since 'view' is just an alias for 'reshape'

* improved tests for 'view' op
This commit is contained in:
ihar
2025-06-07 21:15:31 -05:00
committed by GitHub
parent e88fe41d37
commit 74b849b5e1
2 changed files with 6 additions and 1 deletions

View File

@@ -1860,6 +1860,11 @@ class TestOps(unittest.TestCase):
def test_view(self):
helper_test_op([(4,3,6,6)], lambda x: x.view((12,6,6)))
helper_test_op([(4,3,6,6)], lambda x: x.view((-1,3,6,6)))
helper_test_op([(6,)], lambda x: x.view(2, 3))
helper_test_op([(6,1)], lambda x: x.view([2, 3]))
helper_test_op([(1,6)], lambda x: x.view((3, 2)))
helper_test_op([(3,2)], lambda x: x.view((2, 3)))
helper_test_op([(3,2)], lambda x: x.view(6))
def test_flip(self):
helper_test_op([(4,3,6,6)], lambda x: x.flip((0,)))