matmul

Why is the result of matrix multiply in torch so different when i roll the matrix?

Why is the result of matrix multiply in torch so different when i roll the matrix? Question: Although there is a problem with the accuracy of floating-point multiplication, the gap is slightly larger. And it is also related to the roll step. x = torch.rand((1, 5)) y = torch.rand((5, 1)) print("%.10f"%torch.matmul(x,y)) >>> 1.2710412741 print("%.10f"%torch.matmul(torch.roll(x, 1, …

Total answers: 2