def distorted_inputs(batch_size=FLAGS.batch_size, num_epochs=FLAGS.num_epochs):
  if not num_epochs:
    num_epochs = None
  filename = os.path.join(FLAGS.train_dir,
                          TRAIN_FILE)

  with tf.name_scope('input'):
    filename_queue = tf.train.string_input_producer(
      [filename], num_epochs=num_epochs, name='string_DISTORTED_input_producer')

    # Even when reading in multiple threads, share the filename
    # queue.
    image, label = read_and_decode(filename_queue)

    # Reshape to [32, 32, 3] as distortion methods need this shape
    image = tf.reshape(image, IMAGE_SHAPE)
    # image.set_shape(IMAGE_SHAPE)

    height = IMAGE_SIZE
    width = IMAGE_SIZE

    # Image processing for training the network. Note the many random
    # distortions applied to the image.

    # Randomly crop a [height, width] section of the image.
    distorted_image = tf.image.random_crop(image, [height, width])
    #
    # Randomly flip the image horizontally.
    distorted_image = tf.image.random_flip_left_right(distorted_image)
    #
    # Because these operations are not commutative, consider randomizing
    # randomize the order their operation.
    distorted_image = tf.image.random_brightness(distorted_image,
                                                 max_delta=63)
    distorted_image = tf.image.random_contrast(distorted_image,
                                               lower=0.2, upper=1.8)

    # # Subtract off the mean and divide by the variance of the pixels.
    float_image = tf.image.per_image_whitening(distorted_image)

    # Reshape back to original placeholder shape and other architecture
    image = tf.reshape(float_image, [my_cifar.n_input])
    # image = tf.reshape(image, [my_cifar.n_input])
    # image.set_shape([my_cifar.n_input])

    # Ensure that the random shuffling has good mixing properties.
    min_fraction_of_examples_in_queue = 0.4
    min_queue_examples = int(NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN *
                             min_fraction_of_examples_in_queue)
    images, sparse_labels = tf.train.shuffle_batch([image, label],
                                                   batch_size=batch_size,
                                                   num_threads=5,
                                                   capacity=min_queue_examples + 3 * batch_size,
                                                   enqueue_many=False,
                                                   # Ensures a minimum amount of shuffling of examples.
                                                   min_after_dequeue=min_queue_examples,
                                                   name='batching_shuffling_distortion')

  return images, sparse_labels
Return the chunks for the given diff information.
dataset/ETHPy150Open HamedMP/ImageFlow/example_project/input_data.py/distorted_inputs--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/diffviewer/chunk_generator.py/RawDiffChunkGenerator.get_chunks