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

Method test_sum

test/test_tiny.py:39–41  ·  view source on GitHub ↗
(self, N=getenv("SUM_N", 256))

Source from the content-addressed store, hash-verified

37 self.assertListEqual(out.tolist(), [1]*8+[0]*8)
38
39 def test_sum(self, N=getenv("SUM_N", 256)):
40 out = Tensor.ones(N).contiguous().sum()
41 self.assertEqual(out.item(), N)
42
43 def test_gemm(self, N=getenv("GEMM_N", 64)):
44 a = Tensor.ones(N,N).contiguous()

Callers

nothing calls this directly

Calls 5

getenvFunction · 0.90
sumMethod · 0.80
itemMethod · 0.80
contiguousMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected