title: Tensorflow get indices of values in a tensor
body: <p>Given a matrix and vector， I want to find the indices of the values in the corresponding rows of the matrix.</p>
  
  <pre><code>m = tf.constant([[0, 2, 1],[2, 0, 1]])  # matrix
  y = tf.constant([1,2])  # values whose indices should be found
  </code></pre>
  
  <p>the ideal output is [2,0] because the first value of y, 1, is at the index 2 of the first vector of m. The second value of y, 2, is at the index 0 of the second vector of m. </p>