support symbolic reshape with non-contiguous (#4844)

* support symbolic reshape with non-contiguous

pre-requisite for symbolic arange (make symbolic ones that can be folded).

* test cases

* typo

* shorter
This commit is contained in:
chenyu
2024-06-05 16:01:19 -04:00
committed by GitHub
parent a352b6d9ce
commit 99e7a1d5e9
3 changed files with 51 additions and 5 deletions

View File

@@ -182,8 +182,7 @@ class TestSymbolicJit(unittest.TestCase):
jf = TinyJit(f)
for i in range(1, 5):
vi = Variable("i", 1, 10).bind(i)
# TODO: without contiguous, the CONST shape are different in jit
t = Tensor.ones(i).contiguous()
t = Tensor.ones(i)
symbolic = jf(t.reshape(vi)).item()
expected = f(t).item()
np.testing.assert_equal(symbolic, expected)