title: How does the tf.train.batch_join() function in tensorflow work?
body: <p>I am trying to train a neural network in tensorflow. I load the data along with its labels using the tf.train.batch_join() fucntion. I do something like this: </p>
  
  <pre><code>image_batch, label_batch, image_batch_f = tf.train.batch_join(
          images_and_labels, batch_size=batch_size_placeholder,
          #shapes=[(args.image_size, args.image_size, 3), ()], enqueue_many=True,
          shapes=[(args.image_height, args.image_width, 3), (), (args.image_height, args.image_width, 3)], enqueue_many=True,
          capacity=4 * nrof_preprocess_threads * args.batch_size,
          allow_smaller_final_batch=True)
      image_batch = tf.identity(image_batch, 'image_batch')
      image_batch = tf.identity(image_batch, 'input')
      label_batch = tf.identity(label_batch, 'label_batch')
      image_batch_f = tf.identity(image_batch_f, 'flipped_images_batch')
  </code></pre>
  
  <p>Here, I get three batches of data. A batch of images, a batch of labels and a batch of flipped images of the same images as in the batch of images. I want to extract features on the batch of images and flipped images. The lines below pass the batches of data through the network.</p>
  
  <pre><code>    # Build the inference graph
      prelogits, _ = network.inference(image_batch, args.keep_probability,
          phase_train=phase_train_placeholder, feature_dimension=args.embedding_size,
          weight_decay=args.weight_decay)
  
  
      features = tf.nn.l2_normalize(prelogits, 1, 1e-10, name='embeddings')
  
      #getting the flipped embeddings
      prelogits_f, _ = network.inference(image_batch_f,args.keep_probability,
                      phase_train=phase_train_placeholder,feature_dimension=args.embedding_size,
                      weight_decay=args.weight_decay,reuse=True)
      features_flipped_images = tf.nn.l2_normalize(prelogits_f,1,1e-10,name='embeddings_f')
  </code></pre>
  
  <p>For getting both the features, I run a session.run() on the features and features_flipped_images ops. Something like this:</p>
  
  <pre><code>feed_dict = {phase_train_placeholder:False, batch_size_placeholder:batch_size}
  emb, emb_f = sess.run([features, features_flipped_images],feed_dict=feed_dict)
  </code></pre>
  
  <p>My question is the following. I am guessing when I do a session run on the features, that is when the batch_join function will dispatch a batch of images of size batch_size. But then when I do a session.run() on the features_flipped_images, that function will also get a batch of flipped images from the batch_join function. Does the batch_join function dispatch a fresh batch of flipped images when features_flipped_images is executed? Or is it the same batch of flipped images which was generated when features was executed? If not then how do I do this? I want to extract features on the batch of images and a batch of flipped images. </p>