Columnwise/elementwise operations

I don’t think torch.mul works if two tensors are not broadcastable.

For example,
x = torch.ones(3,2)
y = torch.ones(3)
torch.mul(x,y)

Gives an error:
RuntimeError: The size of tensor a (2) must match the size of tensor b (3) at non-singleton dimension 1
I am yet not able to find solution to how to multiply all columns of one tensor with other tensor

Ok found the solution: