Is it possible to perform a column-wise operation element-wise? For example, if I have the following tensors
A = torch.ones(3, 2)
B = torch.ones(3)

I would like to multiply each column (elementwise) of A with with B, which would result in a (3x2) matrix of 2s, or add each column of A with B which would result in a (3x2) matrix of 3s.
I recognize that I can do this procedure with a for loop, but want to know if there’s a way to do it “within” pytorch.