diff options
author | Geoffrey Irving <geoffreyi@google.com> | 2017-06-29 11:44:13 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-29 11:48:10 -0700 |
commit | e85d3df92deb9d717befdf173966a2913ac2aea0 (patch) | |
tree | 1c9e80f85c965e039121d8591daab95c62fe7041 /tensorflow/core/graph/graph.cc | |
parent | 9b11f458196f6f0528c9974238497a6c8b6da547 (diff) |
Prepare to remove a bunch of proto.h includes from tensorflow/core headers
The goal is to make kernels mostly independent of proto headers, which will let
us lock down our .so imports. This CL does not remove any actual headers, but
changes a bunch of files so that header removal is possible in a followup CL.
It also marks the headers that will be removed with
// TODO(b/62899350): Remove
RELNOTES: n/a
PiperOrigin-RevId: 160552878
Diffstat (limited to 'tensorflow/core/graph/graph.cc')
-rw-r--r-- | tensorflow/core/graph/graph.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tensorflow/core/graph/graph.cc b/tensorflow/core/graph/graph.cc index e06e479264..9469e3f98f 100644 --- a/tensorflow/core/graph/graph.cc +++ b/tensorflow/core/graph/graph.cc @@ -16,9 +16,11 @@ limitations under the License. #include "tensorflow/core/graph/graph.h" #include <vector> +#include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def.pb.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op_kernel.h" +#include "tensorflow/core/framework/versions.pb.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/lib/strings/strcat.h" @@ -255,9 +257,11 @@ Status Node::input_node(int idx, const Node** const_n) const { // Graph Graph::Graph(const OpRegistryInterface* ops) - : ops_(ops, FunctionDefLibrary()), arena_(8 << 10 /* 8kB */) { - versions_.set_producer(TF_GRAPH_DEF_VERSION); - versions_.set_min_consumer(TF_GRAPH_DEF_VERSION_MIN_CONSUMER); + : ops_(ops, FunctionDefLibrary()), + versions_(new VersionDef), + arena_(8 << 10 /* 8kB */) { + versions_->set_producer(TF_GRAPH_DEF_VERSION); + versions_->set_min_consumer(TF_GRAPH_DEF_VERSION_MIN_CONSUMER); // Initialize the name interning table for assigned_device_name. device_names_.push_back(""); @@ -301,6 +305,9 @@ Graph::~Graph() { // destroy them. } +const VersionDef& Graph::versions() const { return *versions_; } +void Graph::set_versions(const VersionDef& versions) { *versions_ = versions; } + Node* Graph::AddNode(const NodeDef& node_def, Status* status) { const OpDef* op_def; status->Update(ops_.LookUpOpDef(node_def.op(), &op_def)); |