code: def create_inference_graph(model, input_pipeline, batch_size=32):
      """Creates a graph to perform inference.
  
      Args:
        task: An `InferenceTask` instance.
        input_pipeline: An instance of `InputPipeline` that defines
          how to read and parse data.
        batch_size: The batch size used for inference
  
      Returns:
        The return value of the model function, typically a tuple of
        (predictions, loss, train_op).
      """
  
      # TODO: This doesn't really belong here.
      # How to get rid of this?
      if hasattr(model, "use_beam_search"):
          if model.use_beam_search:
              tf.logging.info(
                  "Setting batch size to 1 for beam search."
              )
              batch_size = 1
  
      input_fn = training_utils.create_input_fn(
          pipeline=input_pipeline,
          batch_size=batch_size,
          allow_smaller_final_batch=True,
      )
  
      # Build the graph
      features, labels = input_fn()
      return model(features=features, labels=labels, params=None)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from seq2seq.training import utils
label_desc: Use image node_id 1 for calling a global function with example usage: create_inference_graph(model, input_pipeline, batch_size) and returns: model