Dot: Expected 1-D argument tensor, but got 2-D

Hi their !!
I have some problem in my code it torch.dot product

``````ypo=torch.tensor([[4,6,7],[4,6,7],[4,6,7]],dtype=torch.float)
yo=torch.tensor([4,6,7],dtype=torch.float)
xyz=torch.dot(yo,ypo)

``````

this give error it is
dot: Expected 1-D argument tensor, but got 2-D
plz help me …

Are you lookiing for torch.matmul?

Best regards

Thomas

Hi @tom,

Just curious, there is another function `torch.mm` which can do the same multiplication. Which one is the updated one?

Thanks

For matrix x vector `torch.mv` would work, too.

Best regards

Thomas