title: Pytorch Set value for Tensor with index tensor
body: <p>Suppose i have a 2d index Array of shape [B,1,N,2] i.e N points holding indexes on a target tensor of size [B,1,H,W].
  what is the best way to assign value to all the indices in the tensor?</p>
  <p>for example:</p>
  <pre><code>for b in batchsize:
    for i in N: 
      target[b,0,ind[i,0],ind[i,1]] = 1 
  </code></pre>
  <p>but not in loop form
  thanks</p>