mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
copy is already contiguous (#8886)
This commit is contained in:
@@ -774,10 +774,9 @@ class TestMultiTensor(unittest.TestCase):
|
||||
zeros = Tensor.zeros(3).realize()
|
||||
b = a.to(devices_2)*zeros.to(devices_2)
|
||||
sched = b.schedule()
|
||||
self.assertEqual(len(sched), 8)
|
||||
self.assertEqual(len(sched), 6)
|
||||
# notably, only two copies (for the arange) - vs 4 copies if we didn't fold the const copy
|
||||
self.assertEqual(len([x for x in sched if any(u.op is Ops.COPY for u in x.ast.toposort)]), 2)
|
||||
# all these kernels are just because multi calls contiguous on every single shard
|
||||
run_schedule(sched)
|
||||
self.assertListEqual(b.tolist(), [0, 0, 0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user