MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / function_from_graph_def

Function function_from_graph_def

tensorflow/python/eager/wrap_function.py:615–636  ·  view source on GitHub ↗

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

(graph_def, inputs, outputs)

Source from the content-addressed store, hash-verified

613
614
615def function_from_graph_def(graph_def, inputs, outputs):
616 """Creates a ConcreteFunction from a GraphDef.
617
618 Args:
619 graph_def: A GraphDef to make a function out of.
620 inputs: A Tensor name or nested structure of names in `graph_def` which
621 should be inputs to the function.
622 outputs: A Tensor name or nested structure of names in `graph_def` which
623 should be outputs of the function.
624
625 Returns:
626 A ConcreteFunction.
627 """
628
629 def _imports_graph_def():
630 importer.import_graph_def(graph_def, name="")
631
632 wrapped_import = wrap_function(_imports_graph_def, [])
633 import_graph = wrapped_import.graph
634 return wrapped_import.prune(
635 nest.map_structure(import_graph.as_graph_element, inputs),
636 nest.map_structure(import_graph.as_graph_element, outputs))

Callers

nothing calls this directly

Calls 2

wrap_functionFunction · 0.85
pruneMethod · 0.80

Tested by

no test coverage detected