mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
fix _to_const_val and const folding around it (#4017)
* fix _to_const_val and const folding around it is_unrealized_contiguous_const is too strict and almost never hit if const is expanded. suffice to check if there's no pad * that test is folded * test_const_folding
This commit is contained in:
@@ -338,11 +338,6 @@ class TestJit(unittest.TestCase):
|
||||
assert isinstance(jf.jit_cache[1].prg, graph_t)
|
||||
|
||||
def test_jit_const_inputs(self):
|
||||
@TinyJit
|
||||
def f(x,y): return (x+y).realize()
|
||||
for _ in range(5):
|
||||
np.testing.assert_equal(f(Tensor.ones(3), Tensor.zeros(3)).numpy(), np.ones(3))
|
||||
|
||||
@TinyJit
|
||||
def g(x,y,z): return (x+y+z).realize()
|
||||
for i in range(5):
|
||||
|
||||
Reference in New Issue
Block a user