code: def load_predictions(
      signature_def: tf.compat.v1.MetaGraphDef.SignatureDefEntry,
      graph: tf.Graph,
  ) -> Dict[str, types.TensorType]:
      """Loads prediction nodes from signature_def.outputs.
  
      Args:
        signature_def: SignatureDef to lookup nodes in.
        graph: TensorFlow graph to lookup the nodes in.
  
      Returns:
        Predictions map as an OrderedDict.
      """
      # The canonical ordering we use here is simply the ordering we get
      # from the predictions collection.
      predictions = extract_signature_inputs_or_outputs_with_prefix(
          constants.PREDICTIONS_NAME,
          signature_def.outputs,
          util.default_dict_key(constants.PREDICTIONS_NAME),
      )
      predictions_map = collections.OrderedDict()
      for k, v in predictions.items():
          # Extract to dictionary with a single key for consistency with
          # how features and labels are extracted.
          predictions_map[
              k
          ] = tf.compat.v1.saved_model.utils.get_tensor_from_tensor_info(
              v, graph
          )
      return predictions_map
  
imports: import collections
  from typing import Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from google.protobuf import any_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: load_predictions(signature_def, graph) and returns: predictions_map