MCPcopy
hub / github.com/tinygrad/tinygrad / test_multi_output

Method test_multi_output

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

Source from the content-addressed store, hash-verified

20 self.assertEqual(out.item(), 16.0)
21
22 def test_multi_output(self):
23 a = Tensor([1.,2,3])
24 b = Tensor([4.,5,6])
25 c = a + b
26 d = a * b
27 c.callify(d)
28 self.assertListEqual(c.tolist(), [5.0, 7.0, 9.0])
29 self.assertListEqual(d.tolist(), [4.0, 10.0, 18.0])
30
31 def test_two_callify_independent(self):
32 a = Tensor([1.,2,3])

Callers

nothing calls this directly

Calls 3

TensorClass · 0.90
callifyMethod · 0.80
tolistMethod · 0.45

Tested by

no test coverage detected