title: Tensorflow "map operation" for tensor?
body: <p>I am  adapting the <a href="https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/image/cifar10/cifar10.py" rel="noreferrer">cifar10 convolution example</a> to my problem.  I'd like to change the data input from a design that reads images one-at-a-time from a file to a design that operates on an already-in-memory set of images.  The original <code>inputs()</code> function looks like this:</p>
  
  <pre><code>read_input = cifar10_input.read_cifar10(filename_queue)
  reshaped_image = tf.cast(read_input.uint8image, tf.float32)
  # Crop the central [height, width] of the image.
  resized_image = tf.image.resize_image_with_crop_or_pad(reshaped_image,
                                                       width, height)
  </code></pre>
  
  <p>In the original version, <code>read_input</code> is a tensor containing one image.</p>
  
  <p>I keep all my images in RAM, so instead of using <code>filename_queue</code>, I have one huge <code>images_tensor = tf.constant(images)</code>, where <code>images_tensor.shape</code> is (something, 32, 32, 3).</p>
  
  <p>My question is very-very basic:  what is the best way to apply some function (<code>tf.image.resize_image_with_crop_or_pad</code> in my case) to all elements of  <code>images_tensor</code>? </p>
  
  <p>Iterating is problematic in tensorflow, with limited slices(<a href="https://stackoverflow.com/questions/33736795/tensorflow-numpy-like-tensor-indexing">TensorFlow - numpy-like tensor indexing</a>).  Is there a solution to achieving this using just one command?</p>