aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api.cc
diff options
context:
space:
mode:
authorGravatar Igor Ganichev <iga@google.com>2017-08-19 10:25:30 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-19 10:29:34 -0700
commite1030858725b485b0f848cc27597b8e2c2d8383f (patch)
tree1bdfcf53434398a44bbe6ab42b8f2feb24cdbbc1 /tensorflow/c/c_api.cc
parent181267c51f4827e351bb64a620b3dff83539bc11 (diff)
Don't create cond_input and body_input nodes when finishing while loop
These nodes are not needed, but they caused failures in functions with while loops because functions currently execute all ops in their bodies and these ops are placeholders without feeds. PiperOrigin-RevId: 165814802
Diffstat (limited to 'tensorflow/c/c_api.cc')
-rw-r--r--tensorflow/c/c_api.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc
index 77e0cf6757..1ea70f0598 100644
--- a/tensorflow/c/c_api.cc
+++ b/tensorflow/c/c_api.cc
@@ -1931,6 +1931,8 @@ bool CopyGraph(TF_Graph* src_graph, TF_Graph* dst_graph,
TF_ImportGraphDefOptionsAddInputMapping(opts.get(), src.first.data(),
src.second, dst_inputs[i]);
}
+ opts.get()->opts.skip_mapped_nodes = true;
+
// We use the pivot node to control constants in `src_graph`
TF_Operation* pivot = dst_inputs[0].oper;
TF_ImportGraphDefOptionsAddControlDependency(opts.get(), pivot);