title: Tensorflow: analogue for numpy.take?
body: <p>Is there analogue for <code>numpy.take</code>? 
  I want to form <code>N+1</code>-dimensional array from <code>N</code>-dimensional array, more precisely from array with shape <code>(B, H, W, C)</code>  I want to make <code>(B, H, W, X, C)</code> array. </p>
  
  <p>I suppose that for my case there is solution even without such general operation. But I'm really unsure that if I will write code with multiple intermediate operations and tensors (shifting, repeating and so on) TF will be able to optimize it and remove unnecessary operations. Moreover I suppose that such code will be unclean and just awful.</p>
  
  <p>I want to add dimension with shifted values. I.e. for (H,W)->(H,W,3) dimensions case indices must be</p>
  
  <pre><code>[
  [[0,0], #[0,-1], may be padding with zeros but for now pad with edge value
  [0,0],
  [0,1]],
  
  [[0,0],
  [0,1]
  [0,2]]
  ...
  [[1,0],
   [1,0],
   [1,1]],
  
   [[1,0],
   [1,1],
   [1,2]],
  ...
  ]
  </code></pre>
  
  <p>I thought about <code>tf.scatter_nd</code> (<a href="https://www.tensorflow.org/api_docs/python/tf/scatter_nd" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/scatter_nd</a>) but for now I don't understand how to use it. If I understand correctly, I can't use <code>indices</code> with shapes larger than shapes of <code>update</code> array (i.e. I can't use <code>indices</code> with shape <code>(3,4,5,3)</code> and <code>update</code> with shape <code>(3,4,3)</code> or even <code>(3,4,1,3)</code>. If it's so then this operation seems useless until I make intermediate array with shape that I need to form in result.</p>
  
  <p>UPD: may be I'm wrong and tensors operations (shifting, tiling and so on) is more appropriate and efficient solution.
  But in any case I think that analogue for <code>np.take</code> will be useful.  </p>