Commit d85a5765 authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

ImportGraphDef for C++

This change introduces an ImportGraphDef function in C++
that is parallel to import_graph_def() in the Python API.
The intention is for this to be the mechanism to import/enhance
a graph in the C-API (with a TF_GraphImportGraphDef function)
and be used in all language bindings.

There are still two slight differences between the python
import_graph_def and ImportGraphDef introduced here that I hope
to address in the future.
1. Rebinding of nodes to existing tensors
2. Importing nodes with a different producer op registry

With this change, there are 3 ways to convert a GraphDef to a Graph
in C++:
1. ConvertGraphDefToGraph()
2. ImportGraphDef()
3. Implicitly via Session::Extend()

Each of these have slightly different behavior.
However, my understanding of the intention is to:
- Make ImportGraphDef be the primary means of conversion
- Do away with Session::Extend (and thus with TF_ExtendGraph C-API function)

ConvertGraphDefToGraph is used by the runtime. At this point, both ConvertGraphDefToGraph and ImportGraphDef share a bulk of the implementation
with minor differences that I think can be done away with. Deferring that
unification to a future change.
Change: 134014698
parent 929160ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment