MCPcopy
hub / github.com/tinygrad/tinygrad / test_two_callify_shared_input

Method test_two_callify_shared_input

test/unit/test_callify.py:45–52  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

43 self.assertListEqual(f.tolist(), [9.0, 19.0, 29.0])
44
45 def test_two_callify_shared_input(self):
46 a = Tensor([1.,2,3]).contiguous().realize()
47 b = a + 1
48 b.callify()
49 c = a * 2
50 c.callify()
51 self.assertListEqual(b.tolist(), [2.0, 3.0, 4.0])
52 self.assertListEqual(c.tolist(), [2.0, 4.0, 6.0])
53
54 def test_chained_callify(self):
55 a = Tensor([1.,2,3])

Callers

nothing calls this directly

Calls 5

TensorClass · 0.90
realizeMethod · 0.80
callifyMethod · 0.80
contiguousMethod · 0.45
tolistMethod · 0.45

Tested by

no test coverage detected