how to implement tensorflow's next_batch for own data
<p>In the <a href="https://www.tensorflow.org/versions/r0.10/tutorials/mnist/beginners/index.html" rel="noreferrer">tensorflow MNIST tutorial</a> the <code>mnist.train.next_batch(100)</code> function comes very handy. I am now trying to implement a simple classification myself. I have my training data in a numpy array. How could I implement a similar function for my own data to give me the next batch?</p>

<pre><code>sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
Xtr, Ytr = loadData()
for it in range(1000):
    batch_x = Xtr.next_batch(100)
    batch_y = Ytr.next_batch(100)
</code></pre>