test_gemm needs .clone() on eye (#16629)

This commit is contained in:
George Hotz 2026-06-15 12:48:27 -07:00 committed by GitHub
commit 41aa2fe119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,7 @@ class TestTiny(unittest.TestCase):
def test_gemm(self, N=getenv("GEMM_N", 64)):
a = Tensor.ones(N,N).contiguous()
b = Tensor.eye(N).contiguous()
b = Tensor.eye(N).clone()
lst = (out:=a@b).tolist()
for y in range(N):
for x in range(N):
@ -50,7 +50,7 @@ class TestTiny(unittest.TestCase):
def test_gemv(self, N=getenv("GEMV_N", 64), out_dtype=dtypes.float):
a = Tensor.ones(1,N).contiguous()
b = Tensor.eye(N).contiguous()
b = Tensor.eye(N).clone()
lst = (out:=a@b).tolist()
for x in range(N):
self.assertEqual(lst[0][x], 1.0, msg=f"mismatch at {x}")