title: Tensorflow mask from one-hot encoding
body: <p>I have labels that are OHE in the form of <code>examples = tf.placeholder(tf.int32, [batch_size])</code> where each example is an <code>int</code> in the range <code>0:ohe_size</code>.</p>
  
  <p>My output is in the form of a softmax probability distribution with a shape <code>[batch_size, ohe_size]</code></p>
  
  <p>I'm trying to work out how to create a mask that will give me just the probability distribution for each example. e.g.</p>
  
  <pre><code>probs = [[0.1, 0.6, 0.3]
           [0.2, 0.1, 0.7]
           [0.9, 0.1, 0.0]]
  examples = [2, 2, 0]
  
  some_mask_func(probs, example) # &lt;- Need this function    
  &gt; [0.3, 0.7, 0.9]
  </code></pre>