MCPcopy
hub / github.com/tinygrad/tinygrad / test_add_slice

Method test_add_slice

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

Source from the content-addressed store, hash-verified

36
37 @unittest.skip("depends on subbuffer working")
38 def test_add_slice(self):
39 a = Tensor.empty(1024, 1024, dtype=dtypes.uint8)[:512]
40 _, mem = get_stats(a+3)
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)

Callers

nothing calls this directly

Calls 2

get_statsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected