Tensor UOps can become a buffer or const after scheduling (#8698)

* spec

* work

* update test_viewed_consts_do_not_realize

* remove
This commit is contained in:
qazal
2025-01-21 05:33:19 -05:00
committed by GitHub
parent e2008c98c3
commit f0d424ecdf
3 changed files with 60 additions and 5 deletions

View File

@@ -71,9 +71,9 @@ class TestTensorUopRepresentation(unittest.TestCase):
def test_viewed_consts_do_not_realize(self):
a = Tensor.ones(10, 10)
print(a.lazydata)
pre_realize = a.lazydata
a.realize()
assert a.lazydata is pre_realize
is_pattern(a, const_pattern)
self.assertEqual(a.lazydata.shape, (10, 10))
# currently, CONSTs have a "fake" BUFFER. this should be fixed
# current: