def parse_image(height, width, image_string):
  """Decodes an image, resizes and scales RGB values to be in [0, 1]."""
  image_decoded = tf.image.decode_image(image_string, channels=3)
  image_decoded.set_shape([None, None, 3])
  image_float = tf.image.convert_image_dtype(image_decoded, tf.float32)
  image_resized = tf.image.resize_image_with_pad(image_float, height, width)
  image = tf.reshape(image_resized, [1, height, width, 3])
  return image
Decodes an image, resizes and scales RGB values to be in [0, 1].
language/question_answering/b2t2/compute_vcr_features.py