test_matmul

This commit is contained in:
George Hotz
2022-09-13 07:51:33 -07:00
parent 894a7cee79
commit 4efde1ba0a

View File

@@ -92,6 +92,10 @@ class TestOps(unittest.TestCase):
helper_test_op([(45,65)], _mish_pytorch, Tensor.mish, atol=1e-4)
def test_dot(self):
helper_test_op([(45,65), (65,100)], lambda x,y: x.matmul(y), Tensor.dot, atol=1e-4)
def test_matmul(self):
helper_test_op([(65), (65,100)], lambda x,y: x.matmul(y), Tensor.dot, atol=1e-4)
helper_test_op([(512), (512,802)], lambda x,y: x.matmul(y), Tensor.dot, atol=1e-4)
helper_test_op([(802), (802,512)], lambda x,y: x.matmul(y), Tensor.dot, atol=1e-4)
def test_broadcastdot(self):
helper_test_op([(10,45,65), (65,45)], lambda x,y: x @ y, Tensor.dot, atol=1e-4)
def test_multidot(self):