title: TensorFlow: using a tensor to index another tensor
body: <p>I have a basic question about how to do indexing in TensorFlow.</p>
  
  <p>In numpy:</p>
  
  <pre><code>x = np.asarray([1,2,3,3,2,5,6,7,1,3])
  e = np.asarray([0,1,0,1,1,1,0,1])
  #numpy 
  print x * e[x]
  </code></pre>
  
  <p>I can get</p>
  
  <pre><code>[1 0 3 3 0 5 0 7 1 3]
  </code></pre>
  
  <p>How can I do this in TensorFlow?</p>
  
  <pre><code>x = np.asarray([1,2,3,3,2,5,6,7,1,3])
  e = np.asarray([0,1,0,1,1,1,0,1])
  x_t = tf.constant(x)
  e_t = tf.constant(e)
  with tf.Session():
      ????
  </code></pre>
  
  <p>Thanks!</p>