mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-02-05 20:24:57 -05:00
VALID early folding (#8100)
* fold valid * :) * fix test_verify_ast * keep symbolic working
This commit is contained in:
@@ -1905,7 +1905,7 @@ class TestView(unittest.TestCase):
|
||||
b = a.pad(((0, 10), None))[10:]
|
||||
sched = check_schedule(b.contiguous(), 1)
|
||||
# TODO: this VALID can clean up, where do we need st?
|
||||
self.assertIs(store_val(sched[-1]), UOp.const_with_shape(b.dtype, 0, b.lazydata.st.shape))
|
||||
self.assertIs(store_val(sched[-1]), UOp.const(b.dtype, 0))
|
||||
run_schedule(sched)
|
||||
np.testing.assert_equal(b.numpy(), 0)
|
||||
|
||||
@@ -1916,7 +1916,7 @@ class TestView(unittest.TestCase):
|
||||
assert b.shape == (10, 10)
|
||||
sched = check_schedule(b.contiguous(), 1)
|
||||
self.assertEqual(sched[-1].ast.full_shape, (10, 10))
|
||||
self.assertIs(store_val(sched[-1]), UOp.const_with_shape(b.dtype, 0, b.lazydata.st.shape))
|
||||
self.assertIs(store_val(sched[-1]), UOp.const(b.dtype, 0))
|
||||
run_schedule(sched)
|
||||
np.testing.assert_equal(b.numpy(), 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user