14 #ifndef TENSORFLOW_GRAPH_GRAPH_CONSTRUCTOR_H_ 15 #define TENSORFLOW_GRAPH_GRAPH_CONSTRUCTOR_H_ 16 #include "tensorflow/core/framework/graph.pb.h" 17 #include "tensorflow/core/graph/graph.h" 18 #include "tensorflow/core/graph/tensor_id.h" 19 #include "tensorflow/core/lib/core/status.h" 28 struct GraphConstructorOptions {
29 GraphConstructorOptions() {}
31 bool allow_internal_ops =
false;
37 bool expect_device_spec =
false;
40 const GraphDef& gdef, Graph* g);
44 extern Status ConvertNodeDefsToGraph(
const GraphConstructorOptions& opts,
45 gtl::ArraySlice<NodeDef> nodes, Graph* g);
47 struct ImportGraphDefOptions {
48 ImportGraphDefOptions()
49 : uniquify_names(false),
50 uniquify_prefix(false),
51 skip_mapped_nodes(false),
52 validate_shape(true) {}
78 std::map<TensorId, TensorId> input_map;
81 bool skip_mapped_nodes;
88 std::vector<string> control_dependencies;
99 std::vector<TensorId> return_tensors;
112 std::vector<string> return_nodes;
114 bool validate_colocation_constraints =
true;
123 struct ImportGraphDefResults {
129 std::vector<std::pair<Node*, Index>> return_tensors;
131 std::vector<Node*> return_nodes;
135 std::vector<TensorId> missing_unused_input_map_keys;
152 extern Status ImportGraphDef(
const ImportGraphDefOptions& opts,
153 const GraphDef& gdef, Graph* g,
154 ShapeRefiner* refiner,
155 ImportGraphDefResults* results =
nullptr);
160 extern void CopyGraph(
const Graph& src, Graph* dest);
162 #endif // TENSORFLOW_GRAPH_GRAPH_CONSTRUCTOR_H_ Status ConvertGraphDefToGraph(const GraphConstructorOptions &opts, const GraphDef &gdef, Graph *g)
Convert GraphDef defined protobuf to type Graph
Definition: graph_constructor.cc:1079
Definition: compile.cc:35