Reputation: 341
I am curious about what the difference is between calling torch.mm(A, B) and A*B?
Looks like torch.mm gives us the desirable result, but A*B sometimes doesn't work.
It will be better if any documentation is provided.
Thank you!
Upvotes: 3
Views: 3065
Reputation: 428
torch.mm(A,B)
is a regular matrix multiplication and A*B
is element-wise multiplication. You can read it on this discussion. For matrix multiplication you can use @
if I am not mistaken as well.
Upvotes: 8