Solved by albanD in post #2 
              
              
                Hi, 
I think you want to expand your indices as Nx1xWxH by doing ind.view(N, 1, 1, 1).expand(N, 1, W, H). 
Then you can use gather to get the values: res = value.gather(ind, 1). 
Then if you want to remove the dimension of size 1, you can do res = res.squeeze(1).