MCPcopy
hub / github.com/tinygrad/tinygrad / test_recursive_add

Method test_recursive_add

test/null/test_schedule.py:1172–1179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1170
1171class TestFusionOp(unittest.TestCase):
1172 def test_recursive_add(self):
1173 st = time.perf_counter()
1174 a = Tensor([1,2,3,4])
1175 for _ in range(24): a = a + a
1176 linear = a.schedule_linear()
1177 prg = to_program(linear.src[-1].src[0], renderer=Device[Device.DEFAULT].renderer)
1178 self.assertLess(time.perf_counter()-st, 2.0)
1179 assert len(prg.src[3].arg.splitlines()) < 250
1180
1181 def test_recursive_add_cmp(self):
1182 st = time.perf_counter()

Callers

nothing calls this directly

Calls 3

schedule_linearMethod · 0.95
TensorClass · 0.90
to_programFunction · 0.90

Tested by

no test coverage detected