import tensorflow as tf

  tf.gfile.DeleteRecursively(tmp_dir)


def run(dataset_dir):
  """Runs the download and conversion operation.

  Args:
    dataset_dir: The dataset directory where the dataset is stored.
  """
  if not tf.gfile.Exists(dataset_dir):
    tf.gfile.MakeDirs(dataset_dir)

  dataset_utils.download_and_uncompress_tarball(_DATA_URL, dataset_dir)

  # First, process the training data:
  #with tf.python_io.TFRecordWriter(training_filename) as tfrecord_writer:
  filenames = []
  for i in range(_NUM_TRAIN_FILES):
    filenames.append(os.path.join(dataset_dir,
                            'cifar-10-batches-py',
