import tensorflow as tf

                                          dtype=tf.float32):
  """Returns a input_receiver_fn for raw images during serving."""

  def _preprocess_image(encoded_image):
    """Preprocess a single raw image."""
    image = tf.image.decode_image(encoded_image, channels=shape[-1])
    image.set_shape(shape)
    return tf.cast(image, dtype)

  def serving_input_receiver_fn():
