Multiply two tensors with different dimensions

Hi all,

How to multiply two tensors with A ~> torch.Size([4]) and B ~> torch.Size([3, 1])

Any help will be appreciated.

How should the multiplication take place, i.e. which value of A should be multiplied with which value(s) of B? An elementwise multiplication isn’t possible, as both tensors have a different number of elements so I guess you would like to apply some kind of matrix multiplication?