MCPcopy
hub / github.com/tinygrad/tinygrad / test_add

Method test_add

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

Source from the content-addressed store, hash-verified

24@unittest.skipIf(Device.DEFAULT == "WEBGPU", "webgpu does extra load/store for packed types")
25class TestMemoryCount(unittest.TestCase):
26 def test_add(self):
27 a = Tensor.empty(1024, 1024, dtype=dtypes.uint8)
28 b = Tensor.empty(1024, 1024, dtype=dtypes.uint8)
29 _, mem = get_stats(a+b)
30 self.assertEqual(mem, 1024*1024*3) # 2 reads + 1 write
31
32 def test_add_const(self):
33 a = Tensor.empty(1024, 1024, dtype=dtypes.uint8)

Callers

nothing calls this directly

Calls 2

get_statsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected