title: Pytorch tensor dimension multiplication
body: <p>I'm trying to implement the grad-camm algorithm:</p>
  <p><a href="https://arxiv.org/pdf/1610.02391.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1610.02391.pdf</a></p>
  <p>My arguments are:</p>
  <p>activations: Tensor with shape <code>torch.Size([1, 512, 14, 14])</code></p>
  <p>alpha values : Tensor with shape <code>torch.Size([512])</code></p>
  <p>I want to multiply each activation (in dimension index 1 (sized 512)) in each corresponding alpha value: for example if the i'th index out of the 512 in the activation is 4 and the i'th alpha value is 5, then my new i'th activation would be 20.</p>
  <p>The shape of the output should be torch.Size([1, 512, 14, 14])</p>