Construct a Graph *g out of a GraphDef gdef. Returns non-OK on error, in which case *g is left in an incomplete state. g is expected to be an empty graph (with no more than a source and sink nodes) when provided to ConvertGraphDefToGraph. To enhance an existing Graph, see ImportGraphDef.
| 31 | // nodes) when provided to ConvertGraphDefToGraph. To enhance an existing Graph, |
| 32 | // see ImportGraphDef. |
| 33 | struct GraphConstructorOptions { |
| 34 | GraphConstructorOptions() {} |
| 35 | |
| 36 | // If true, allows internal ops in the GraphDef. |
| 37 | bool allow_internal_ops = false; |
| 38 | |
| 39 | // If true, the graph def is expected to have fully specified |
| 40 | // devices for all nodes. A node in the resulting graph "g" has the |
| 41 | // device name set accordingly. |
| 42 | // |
| 43 | // TODO(zhifengc): if possible, consider removing this option. |
| 44 | bool expect_device_spec = false; |
| 45 | }; |
| 46 | extern Status ConvertGraphDefToGraph(const GraphConstructorOptions& opts, |
| 47 | const GraphDef& gdef, Graph* g); |
| 48 | extern Status ConvertGraphDefToGraph(const GraphConstructorOptions& opts, |
no outgoing calls