title: Tensorflow Data API - prefetch
body: <p>I am trying to use new features of TF, namely Data API, and I am not sure how <strong>prefetch</strong> works. In the code below</p>
  
  <pre><code>def dataset_input_fn(...)
      dataset = tf.data.TFRecordDataset(filenames, compression_type="ZLIB")
      dataset = dataset.map(lambda x:parser(...))
      dataset = dataset.map(lambda x,y: image_augmentation(...)
                        , num_parallel_calls=num_threads
                       )
  
      dataset = dataset.shuffle(buffer_size)
      dataset = dataset.batch(batch_size)    
      dataset = dataset.repeat(num_epochs)
      iterator = dataset.make_one_shot_iterator()
  </code></pre>
  
  <p>does it matter between each lines above I put <code>dataset=dataset.prefetch(batch_size)</code>? Or maybe it should be after every operation that would be using <code>output_buffer_size</code> if the dataset was coming from <code>tf.contrib.data</code>?</p>