I compared the pytorch’s matrix multiplication with numpy’s, and discovered that they were very different.
The experimental code is as follow：
import torch

a = torch.rand([1000,1000],device='cuda')
b = torch.mm(a,a)
print(b)
a = a.cpu().numpy()
c = a.dot(a)
print(c)
print(torch.sum(torch.abs((b.cpu()-c))))

The output results are as follows:

We can see that the absolute error of the result of the multiplication of two matrices reaches 3000.