def preprocess_for_train(image, image_size=224, normalize=True):
  """Preprocesses the given image for evaluation.

  Args:
    image: `Tensor` representing an image of arbitrary size.
    image_size: int, how large the output image should be.
    normalize: bool, if True the image is normalized.

  Returns:
    A preprocessed image `Tensor`.
  """
  if normalize: image = tf.to_float(image) / 255.0
  image = _random_crop(image, image_size)
  if normalize: image = _normalize(image)
  image = _flip(image)
  image = tf.reshape(image, [image_size, image_size, 3])
  return image
Preprocesses the given image for evaluation.

  Args:
    image: `Tensor` representing an image of arbitrary size.
    image_size: int, how large the output image should be.
    normalize: bool, if True the image is normalized.

  Returns:
    A preprocessed image `Tensor`.