title: TensorFlow: how is dataset.train.next_batch defined?
body: <p>I am trying to learn TensorFlow and studying the example at: <a href="https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/autoencoder.ipynb" rel="noreferrer">https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/autoencoder.ipynb</a></p>
  
  <p>I then have some questions in the code below:</p>
  
  <pre><code>for epoch in range(training_epochs):
      # Loop over all batches
      for i in range(total_batch):
          batch_xs, batch_ys = mnist.train.next_batch(batch_size)
          # Run optimization op (backprop) and cost op (to get loss value)
          _, c = sess.run([optimizer, cost], feed_dict={X: batch_xs})
      # Display logs per epoch step
      if epoch % display_step == 0:
          print("Epoch:", '%04d' % (epoch+1),
                "cost=", "{:.9f}".format(c))
  </code></pre>
  
  <p>Since mnist is just a dataset, what exactly does <code>mnist.train.next_batch</code> mean? How was the <code>dataset.train.next_batch</code> defined?</p>
  
  <p>Thanks!</p>