code: def function_from_graph_def(
      graph_def, inputs, outputs, captures=None
  ):
      """Creates a ConcreteFunction from a GraphDef.
  
      Args:
        graph_def: A GraphDef to make a function out of.
        inputs: A Tensor name or nested structure of names in `graph_def` which
          should be inputs to the function.
        outputs: A Tensor name or nested structure of names in `graph_def` which
          should be outputs of the function.
        captures: (Optional) A dictionary mapping node names in `graph_def` that
          should be captured as inputs to tensors containing the value of the
          captured inputs.
  
      Returns:
        A ConcreteFunction.
      """
  
      def _imports_graph_def():
          importer.import_graph_def(graph_def, name="")
          graph = ops.get_default_graph()
          if captures is not None:
              for c in captures:
                  graph.add_capture(
                      captures[c],
                      graph.get_tensor_by_name(str(c) + ":0"),
                  )
  
      wrapped_import = wrap_function(_imports_graph_def, [])
      import_graph = wrapped_import.graph
      return wrapped_import.prune(
          nest.map_structure(import_graph.as_graph_element, inputs),
          nest.map_structure(import_graph.as_graph_element, outputs),
      )
  
imports: import weakref
  from tensorflow.core.function.polymorphism import function_type
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import struct_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.eager import function
  from tensorflow.python.eager import lift_to_graph
  from tensorflow.python.eager.polymorphic_function import atomic_function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.trackable import data_structures
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 6 for calling a global function with example usage: function_from_graph_def(graph_def, inputs, outputs, captures) and returns: wrapped_import