title: in tensorflow how to return the index of the first matched value in a tensor
body: <p>I have to code in tensorflow's syntax. Here is my expected function:</p>
  
  <pre><code># read the first matched datum's index in a vector
  index = next(idx for idx, value in enumerate(ladder) if value &gt;= 0.99 ) + 1
  </code></pre>
  
  <p>In tensorflow, I've tried</p>
  
  <pre><code>a = tf.greater_equal(ladder, 0.99)
  b = tf.where(a)         # It'll returns all the indices of the matched data
  </code></pre>
  
  <p>But I got no idea how to proceed cause I can't access the value of a tensor.</p>
  
  <p>So my question is how I can get the index of the first matched datum before <code>sess.run</code>?</p>