MCPcopy
hub / github.com/tinygrad/tinygrad / test_gemm

Method test_gemm

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

Source from the content-addressed store, hash-verified

61 self.assertListEqual(c.tolist(), [3.0, 4.0, 5.0])
62
63 def test_gemm(self):
64 a = Tensor.ones(8, 8).contiguous()
65 b = Tensor.eye(8).contiguous()
66 out = a @ b
67 out.callify()
68 lst = out.tolist()
69 for y in range(8):
70 for x in range(8):
71 self.assertEqual(lst[y][x], 1.0)
72
73 def test_int_dtype(self):
74 a = Tensor([1,2,3], dtype=dtypes.int)

Callers

nothing calls this directly

Calls 5

eyeMethod · 0.80
callifyMethod · 0.80
contiguousMethod · 0.45
onesMethod · 0.45
tolistMethod · 0.45

Tested by

no test coverage detected