title: Get the value at a specific index in PyTorch
body: <p>I have a ground truth label array for size 5.</p>
  <pre><code>y=tensor([958,  85, 244, 182, 294])
  </code></pre>
  <p>I have the output for scores array  of shape :  [5,1000]</p>
  <pre><code>scores   =  tensor([[ 1.0406,  1.1808,  4.4227,  ...,  4.6864,  8.0145,  5.2128],
          [ 6.9101,  4.6083,  6.9259,  ...,  9.7415,  9.6305,  9.3974],
          [ 7.6097,  4.0396,  4.4560,  ...,  3.4892, 11.6411, 2],
          [ 1.0693,  4.6295,  5.3638,  ..., 10.9041, 10.8380,  9.2077],
          [ 1.7085,  1.4938,  8.6876,  ..., 15.1423,  9.6055,  9.8920]],
         grad_fn=&lt;ViewBackward&gt;)
  </code></pre>
  <p>I want the value from scores array based on the corresponding index of y. So for y[0], which is 958, I want the corresponding value from scores[1], position 958.</p>
  <p>Is there some direct Pytorch function I can use?</p>