MCPcopy
hub / github.com/tinygrad/tinygrad / test_self_add_assign

Method test_self_add_assign

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

Source from the content-addressed store, hash-verified

66 self.assertEqual(mem, 1024*1024*2) # 1 read + 1 write
67
68 def test_self_add_assign(self):
69 a = Tensor.empty(1024, 1024, dtype=dtypes.uint8).realize()
70 _, mem = get_stats(a.assign(a+a))
71 self.assertEqual(mem, 1024*1024*2) # 1 read + 1 write
72
73 @unittest.skipIf(Device.DEFAULT == "CPU", "test copy to CPU from other device")
74 def test_copyout(self):

Callers

nothing calls this directly

Calls 4

get_statsFunction · 0.85
realizeMethod · 0.80
emptyMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected