title: Broadcasting element wise multiplication in pytorch
body: <p>I have a tensor in pytorch with size <code>torch.Size([1443747, 128])</code>. Let's name it tensor <code>A</code>. In this tensor, 128 represents a batch size. I have another 1D tensor with size <code>torch.Size([1443747])</code>. Let's call it <code>B</code>. I want to do element wise multiplication of B with A, such that B is multiplied with all 128 columns of tensor <code>A</code> (obviously in an element wise manner). In other words, I want to broadcast the element wise multiplication along <code>dimension=1</code>.
  How can I achieve this in pytorch? <br></p>
  <p>It I didn't have a batch size involved in the tensor A (<code>batch size = 1</code>), then normal <code>*</code> operator would do the multiplication easily. <code>A*B</code> then would have generated resultant tensor of size <code>torch.Size([1443747])</code>. However, I don't understand why pytorch is not broadcasting the tensor multiplication along dimension 1? Is there any way to do this?</p>
  <p>What I want is, <code>B</code> should be multiplied with all 128 columns of <code>A</code> in an element wise manner. So, the resultant tensors' size would be <code>torch.Size([1443747, 128])</code>.</p>