# Path: external/datasets_cifar10.py
# _FILE_PATTERN = 'cifar10_%s.tfrecord'
# SPLITS_TO_SIZES = {'train': 50000, 'test': 10000}
# _NUM_CLASSES = 10
# _ITEMS_TO_DESCRIPTIONS = {
#     'image': 'A [32 x 32 x 3] color image.',
#     'label': 'A single integer between 0 and 9',
# }
# def get_split(split_name, dataset_dir, file_pattern=None, reader=None):


import os
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow.contrib.slim import dataset_data_provider
from external import datasets_cifar10



def provide_data(split_name, batch_size, dataset_dir=None):
  """Provides batches of CIFAR data.

  Args:
    split_name: Either 'train' or 'test'.
    batch_size: The number of images in each batch.
    dataset_dir: Directory where the CIFAR-10 TFRecord files live.
                 Defaults to "~/tensorflow/data/cifar10"

  Returns:
    images: A `Tensor` of size [batch_size, 32, 32, 3]
    images_not_whiten: A `Tensor` with the same size of `images`, unwhitened
      images.
    one_hot_labels: A `Tensor` of size [batch_size, num_classes], where
      each row has a single element set to one and the rest set to zeros.
    dataset.num_samples: The number of total samples in the dataset.
    dataset.num_classes: The number of object classes in the dataset.

  Raises:
    ValueError: if the split_name is not either 'train' or 'test'.
  """
  with tf.device('/cpu:0'):
    is_train = split_name == 'train'

    if dataset_dir is None:
      dataset_dir = os.path.expanduser('~/tensorflow/data/cifar10')


# Path: external/datasets_cifar10.py
# _FILE_PATTERN = 'cifar10_%s.tfrecord'
# SPLITS_TO_SIZES = {'train': 50000, 'test': 10000}
# _NUM_CLASSES = 10
# _ITEMS_TO_DESCRIPTIONS = {
#     'image': 'A [32 x 32 x 3] color image.',
#     'label': 'A single integer between 0 and 9',
# }
# def get_split(split_name, dataset_dir, file_pattern=None, reader=None):


# Path: cifar_data_provider.py
import os
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow.contrib.slim import dataset_data_provider
from external import datasets_cifar10




def provide_data(split_name, batch_size, dataset_dir=None):
  """Provides batches of CIFAR data.

  Args:
    split_name: Either 'train' or 'test'.
    batch_size: The number of images in each batch.
    dataset_dir: Directory where the CIFAR-10 TFRecord files live.
                 Defaults to "~/tensorflow/data/cifar10"

  Returns:
    images: A `Tensor` of size [batch_size, 32, 32, 3]
    images_not_whiten: A `Tensor` with the same size of `images`, unwhitened
      images.
    one_hot_labels: A `Tensor` of size [batch_size, num_classes], where
      each row has a single element set to one and the rest set to zeros.
    dataset.num_samples: The number of total samples in the dataset.
    dataset.num_classes: The number of object classes in the dataset.

  Raises:
    ValueError: if the split_name is not either 'train' or 'test'.
  """
  with tf.device('/cpu:0'):
    is_train = split_name == 'train'

    if dataset_dir is None:
      dataset_dir = os.path.expanduser('~/tensorflow/data/cifar10')


    dataset = datasets_cifar10.get_split(split_name, dataset_dir)