MCPcopy
hub / github.com/tinygrad/tinygrad / test_sum

Method test_sum

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

Source from the content-addressed store, hash-verified

15 self.assertEqual(out.item(), 5.0)
16
17 def test_sum(self):
18 out = Tensor.ones(16).contiguous().sum()
19 out.callify()
20 self.assertEqual(out.item(), 16.0)
21
22 def test_multi_output(self):
23 a = Tensor([1.,2,3])

Callers

nothing calls this directly

Calls 5

sumMethod · 0.80
callifyMethod · 0.80
itemMethod · 0.80
contiguousMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected