code: def build_inception_graph(self):
      
      image_str_tensor = tf.placeholder(tf.string, shape=[None])
  
      # The CloudML Prediction API always "feeds" the Tensorflow graph with
      # dynamic batch sizes e.g. (?,).  decode_jpeg only processes scalar
      # strings because it cannot guarantee a batch of images would have
      # the same output size.  We use tf.map_fn to give decode_jpeg a scalar
      # string from dynamic batches.
      image = tf.map_fn(
          _util.decode_and_resize, image_str_tensor, back_prop=False, dtype=tf.uint8)
      # convert_image_dtype, also scales [0, uint8_max] -> [0 ,1).
      image = tf.image.convert_image_dtype(image, dtype=tf.float32)
  
      # Then shift images to [-1, 1) for Inception.
      image = tf.subtract(image, 0.5)
      image = tf.multiply(image, 2.0)
  
      # Build Inception layers, which expect A tensor of type float from [-1, 1)
      # and shape [batch_size, height, width, channels].
      with slim.arg_scope(_inceptionlib.inception_v3_arg_scope()):
        _, end_points = _inceptionlib.inception_v3(image, is_training=False)
  
      inception_embeddings = end_points['PreLogits']
      inception_embeddings = tf.squeeze(
          inception_embeddings, [1, 2], name='SpatialSqueeze')
      return image_str_tensor, inception_embeddings
docs: Builds an inception graph and add the necessary input & output tensors.
  
        To use other Inception models modify this file. Also preprocessing must be
        modified accordingly.
  
        See tensorflow/contrib/slim/python/slim/nets/inception_v3.py for
        details about InceptionV3.
  
      Returns:
        input_jpeg: A placeholder for jpeg string batch that allows feeding the
                    Inception layer with image bytes for prediction.
        inception_embeddings: The embeddings tensor.