MCPcopy
hub / github.com/tinygrad/tinygrad / test_multiple_ops

Method test_multiple_ops

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

Source from the content-addressed store, hash-verified

83 self.assertEqual(out.item(), 10.0)
84
85 def test_multiple_ops(self):
86 a = Tensor([1.,2,3])
87 b = Tensor([4.,5,6])
88 out = (a + b) * (a - b)
89 out.callify()
90 self.assertListEqual(out.tolist(), [-15.0, -21.0, -27.0])
91
92 def test_double_callify(self):
93 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