MCPcopy
hub / github.com/tinygrad/tinygrad / test_dot_vector_matrix

Method test_dot_vector_matrix

extra/torch_backend/test.py:470–475  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

468 np.testing.assert_equal(torch_chunks[i].cpu().numpy(), cpu_chunks[i].numpy())
469
470 def test_dot_vector_matrix(self):
471 a = torch.arange(65, dtype=torch.float32, device=device)
472 b = torch.arange(65*45, dtype=torch.float32, device=device).reshape(65, 45)
473 torch_res = a.matmul(b).reshape(-1).cpu().numpy()
474 cpu_res = torch.arange(65, dtype=torch.float32).matmul(torch.arange(65*45, dtype=torch.float32).reshape(65, 45)).numpy()
475 np.testing.assert_equal(torch_res, cpu_res)
476
477 def test_alias_passthrough(self):
478 a = torch.randn(3, 3, device=device)

Callers

nothing calls this directly

Calls 5

arangeMethod · 0.80
reshapeMethod · 0.80
matmulMethod · 0.80
assert_equalMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected