MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / test_double_alloc

Method test_double_alloc

test/null/test_viz.py:636–643  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

634
635class TestVizMemoryLayout(unittest.TestCase):
636 def test_double_alloc(self):
637 with save_viz():
638 a = _alloc(1)
639 _b = _alloc(1)
640 profile_ret = load_profile(Buffer.profile_events)
641 ret = profile_ret["layout"][f"{a.device} Memory"]
642 self.assertEqual(ret["peak"], 2)
643 self.assertEqual(len(ret["events"]), 4)
644
645 def test_del_once(self):
646 with save_viz():

Callers

nothing calls this directly

Calls 3

save_vizFunction · 0.85
_allocFunction · 0.85
load_profileFunction · 0.85

Tested by

no test coverage detected