aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/graph.cc
diff options
context:
space:
mode:
authorGravatar Igor Ganichev <iga@google.com>2017-10-06 15:25:16 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-06 15:29:49 -0700
commit710efeecbffad94259bdcf5d19ca3a83043cf145 (patch)
tree441dbd36adc546b06aa46cee5a1acd6519d43179 /tensorflow/core/graph/graph.cc
parentc5f715f62e7d8c4fbf9244eefb9379f188e06b98 (diff)
Bump min graph consumer version when adding functions to it
PiperOrigin-RevId: 171352662
Diffstat (limited to 'tensorflow/core/graph/graph.cc')
-rw-r--r--tensorflow/core/graph/graph.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/core/graph/graph.cc b/tensorflow/core/graph/graph.cc
index 2ad0081e1f..daefb6b1fb 100644
--- a/tensorflow/core/graph/graph.cc
+++ b/tensorflow/core/graph/graph.cc
@@ -293,6 +293,11 @@ Graph::Graph(const OpRegistryInterface* ops)
Graph::Graph(const FunctionLibraryDefinition& flib_def)
: Graph(flib_def.default_registry()) {
+ // Need a new-enough consumer to support the functions we add to the graph.
+ if (flib_def.ToProto().function_size() > 0 &&
+ versions_->min_consumer() < 12) {
+ versions_->set_min_consumer(12);
+ }
Status s = ops_.AddLibrary(flib_def);
CHECK(s.ok()) << s.error_message();
}
@@ -448,6 +453,10 @@ const Edge* Graph::FindEdge(const Node* dst, int index) {
}
Status Graph::AddFunctionLibrary(const FunctionDefLibrary& fdef_lib) {
+ // Need a new-enough consumer to support the functions we add to the graph.
+ if (fdef_lib.function_size() > 0 && versions_->min_consumer() < 12) {
+ versions_->set_min_consumer(12);
+ }
return ops_.AddLibrary(fdef_lib);
}