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)
| 613 | |
| 614 | |
| 615 | def 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)) |
nothing calls this directly
no test coverage detected