title: Meaning of buffer_size in Dataset.map , Dataset.prefetch and Dataset.shuffle
body: <p>As per TensorFlow <a href="https://www.tensorflow.org/api_docs/python/tf/data/TFRecordDataset#prefetch" rel="noreferrer">documentation</a> , the <code>prefetch</code> and <code>map</code> methods of <code>tf.contrib.data.Dataset</code> class, both have a parameter called <code>buffer_size</code>.</p>
  <p>For <code>prefetch</code> method, the parameter is known as <code>buffer_size</code> and according to documentation :</p>
  <blockquote>
  <p>buffer_size: A tf.int64 scalar tf.Tensor, representing the maximum
  number elements that will be buffered when prefetching.</p>
  </blockquote>
  <p>For the <code>map</code> method, the parameter is known as <code>output_buffer_size</code> and according to documentation :</p>
  <blockquote>
  <p>output_buffer_size: (Optional.) A tf.int64 scalar tf.Tensor,
  representing the maximum number of processed elements that will be
  buffered.</p>
  </blockquote>
  <p>Similarly for the <code>shuffle</code> method, the same quantity appears and according to documentation :</p>
  <blockquote>
  <p>buffer_size: A tf.int64 scalar tf.Tensor, representing the number of
  elements from this dataset from which the new dataset will sample.</p>
  </blockquote>
  <p>What is the relation between these parameters ?</p>
  <p>Suppose I create a<code>Dataset</code> object as follows :</p>
  <pre><code> tr_data = TFRecordDataset(trainfilenames)
      tr_data = tr_data.map(providefortraining, output_buffer_size=10 * trainbatchsize, num_parallel_calls\
  =5)
      tr_data = tr_data.shuffle(buffer_size= 100 * trainbatchsize)
      tr_data = tr_data.prefetch(buffer_size = 10 * trainbatchsize)
      tr_data = tr_data.batch(trainbatchsize)
  </code></pre>
  <p>What role is being played by the <code>buffer</code> parameters in the above snippet ?</p>