MCPcopy
hub / github.com/tinygrad/tinygrad / test_expanded

Method test_expanded

test/null/test_uops_stats.py:43–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41 self.assertEqual(mem, 512*1024*2) # 1 read + 1 write
42
43 def test_expanded(self):
44 a = Tensor.empty(1024, 1, dtype=dtypes.uint8).expand(1024, 1024)
45 b = Tensor.empty(1024, 1024, dtype=dtypes.uint8)
46 _, mem = get_stats(a+b)
47 self.assertEqual(mem, 1024*1024*2 + 1024) # 1 full read + 1 lil read + 1 write
48
49 @unittest.skip("no longer supported")
50 def test_both_expanded(self):

Callers

nothing calls this directly

Calls 3

get_statsFunction · 0.85
expandMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected