mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
rangeify: late zero folding (#12464)
* rangeify: late zero folding * early * not kernels * none * multi * linter * mstack is sink comment * more comment
This commit is contained in:
@@ -814,6 +814,14 @@ class TestSchedule(unittest.TestCase):
|
||||
check_schedule(a, 0)
|
||||
self.assertEqual(a.tolist(), [])
|
||||
|
||||
def test_zero_size_children(self):
|
||||
r = Tensor.ones(1,2).contiguous().realize().sum(axis=(1,), keepdim=True)
|
||||
ax = r.reshape(1)*2
|
||||
ay = r.reshape(1).shrink(((1,1),))*2
|
||||
out = ax+ay.pad(((1, 0),))
|
||||
run_schedule(check_schedule(out, 1))
|
||||
self.assertEqual(out.item(), 4.)
|
||||
|
||||
def test_reduce_permute_nofuse(self):
|
||||
x = Tensor.empty(32, 32, 32)
|
||||
y = Tensor.empty(32, 32)
|
||||
|
||||
Reference in New Issue
Block a user