Add new overload of `GraphToFunctionDef()` that can consume the graph.
Previously, we copied all of the node data from the input subgraph to the `FunctionDef`. This change reduces the memory footprint of multi-device function instantiation by (where possible) `std::move`-ing the bulk of the node data from the input graph to newly created `NodeDef` members of the resulting `FunctionDef` protocol buffer. PiperOrigin-RevId: 617641191
Showing
- tensorflow/core/common_runtime/process_function_library_runtime.cc 2 additions, 1 deletion...w/core/common_runtime/process_function_library_runtime.cc
- tensorflow/core/framework/graph_to_functiondef.cc 163 additions, 102 deletionstensorflow/core/framework/graph_to_functiondef.cc
- tensorflow/core/framework/graph_to_functiondef.h 5 additions, 0 deletionstensorflow/core/framework/graph_to_functiondef.h
Please register or sign in to comment