Matrix Multiplication for 1D #1214
Replies: 2 comments
-
|
I believe that behind the scenes torch just returns the dot product of the two vectors |
Beta Was this translation helpful? Give feedback.
-
|
Hello, There! I was unsure about it too, but it seems that it was a bug, which is now fixed, I am using Pytorch version import torch
tensor = torch.tensor([1, 2, 3])
print(torch.matmul(tensor, tensor))Output was: So, as in course it's said that for matrix multiplication inner dimention must be same, so I tried this import torch
tensor = torch.tensor([1, 2, 3])
print(torch.matmul(tensor, tensor.T)) # After transposeOutput was: Inshort, yep it dosen't make sense in video that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the course, we have tensor = torch.tensor([1,2,3]) which has 1D only. In this case how matrix multiplication works. As per the rules it should have same inner dimensions. When we do
torch.matmul(tensor, tensor)how the 2 rules of matrix multiplications are applied here?Beta Was this translation helpful? Give feedback.
All reactions