fix view add with symbolic shape (#7569)

the issue is that the symbolic shape is not greedily simplified and canonicalized before reshape
This commit is contained in:
chenyu
2024-11-06 11:39:20 -05:00
committed by GitHub
parent fbd7d16e9e
commit a011562450
2 changed files with 3 additions and 2 deletions

View File

@@ -28,7 +28,6 @@ class TestSymbolic(unittest.TestCase):
st = ShapeTracker(views=(View(shape=(3, (Variable('i', 1, 10)+Variable('j', 1, 10))), strides=(Variable('i', 1, 10), 1), offset=0, mask=((0, 3), (0, Variable('i', 1, 10))), contiguous=False),)) # noqa: E501
self.assertEqual(st.real_strides(), (Variable('i', 1, 10), None))
@unittest.expectedFailure # passes in 0.9.2
def test_merge_view_recursion_err(self):
vm2 = View(shape=(Variable('j', 1, 10),), strides=(0,), offset=0, mask=None, contiguous=False)
vm1 = View(shape=(1,), strides=(0,), offset=0, mask=None, contiguous=True)