MCPcopy
hub / github.com/tinygrad/tinygrad / test_schedule_gc

Method test_schedule_gc

test/null/test_gc.py:59–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 Tensor.manual_seed(0)
58
59 def test_schedule_gc(self):
60 init = bufs_allocated()
61 x = Tensor.ones(256).contiguous().realize()
62 y = Tensor.ones(5, 5).contiguous()
63 y.schedule_linear()
64 del x
65 del y
66 self.assertEqual(bufs_allocated()-init, 0)
67
68 def test_schedule_gc_with_inputs(self):
69 init = bufs_allocated()

Callers

nothing calls this directly

Calls 5

realizeMethod · 0.80
schedule_linearMethod · 0.80
bufs_allocatedFunction · 0.70
contiguousMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected