clean up reshape size check [pr] (#8067)

removed a resolve, and remove special case for 0 size assert since it's covered by generic size check
This commit is contained in:
chenyu
2024-12-06 07:51:19 -05:00
committed by GitHub
parent 074a67a6eb
commit a77ee72d11
2 changed files with 3 additions and 6 deletions

View File

@@ -573,7 +573,7 @@ class TestZeroShapeTensor(unittest.TestCase):
a = t.reshape(0)
assert a.shape == (0,)
np.testing.assert_equal(a.numpy(), np.zeros((0,)))
with self.assertRaises(AssertionError):
with self.assertRaises(ValueError):
# cannot reshape from size 0 to size 1
a = t.reshape(())