mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
Better cleanup of arange bufferize (#13046)
* check for reduce and index instead of cast * add test
This commit is contained in:
@@ -1500,6 +1500,7 @@ class TestSchedule(unittest.TestCase):
|
||||
y = x.pad((-1,2,2,-1), mode="replicate")
|
||||
dx = y.sum().gradient(x)[0]
|
||||
sched = check_schedule(dx, 1)
|
||||
self.assertEqual(sched[0].ast.op_in_backward_slice_with_self(Ops.REDUCE), False)
|
||||
run_schedule(sched)
|
||||
np.testing.assert_allclose(dx.numpy(), [[[[0.,3.,9.],[0,1.,3.],[0.,0.,0.]]]*3]*3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user