MCPcopy
hub / github.com/tinygrad/tinygrad / test_add_const

Method test_add_const

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

Source from the content-addressed store, hash-verified

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)
34 _, mem = get_stats(a+3)
35 self.assertEqual(mem, 1024*1024*2) # 1 read + 1 write
36
37 @unittest.skip("depends on subbuffer working")
38 def test_add_slice(self):

Callers

nothing calls this directly

Calls 2

get_statsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected