def prepare_feed_dict(placeholders, images, labels, batch_size, use_generated_data, idx=0):
    """Return the feed dict per batch with the input data."""
    idx = idx * batch_size
    if use_generated_data:
        return {
            placeholders[0]: images
        }
    return {
        placeholders[0]: images[idx:idx+batch_size],
        placeholders[1]: labels[idx:idx+batch_size]
    }