title: How Pytorch Tensor get the index of specific value
body: <p>With python lists, we can do:</p>
  <pre><code>a = [1, 2, 3]
  assert a.index(2) == 1
  </code></pre>
  <p>How can a pytorch tensor find the <code>.index()</code> directly?</p>