aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-28 10:16:51 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-28 10:21:16 -0700
commit6233d8a75c17bedc2b082f6ef32fb150ac2b28b9 (patch)
treedd0b1416bde8ff6f3c96523c4ab649bfa9689933 /tensorflow
parent9a45d4d6bab843424c3994798fc7fa4e1e04db56 (diff)
Only process Merge nodes involved with loops in Grappler shape inference
PiperOrigin-RevId: 160422523
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/core/grappler/costs/graph_properties.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/tensorflow/core/grappler/costs/graph_properties.cc b/tensorflow/core/grappler/costs/graph_properties.cc
index 7ac35ef271..0b92237dc7 100644
--- a/tensorflow/core/grappler/costs/graph_properties.cc
+++ b/tensorflow/core/grappler/costs/graph_properties.cc
@@ -200,8 +200,12 @@ Status GraphProperties::InferStatically() {
}
if (node->IsEnter()) {
enter_nodes.insert(node);
- } else if (node->IsMerge()) {
- merge_nodes.insert(node);
+ } else if (node->IsNextIteration()) {
+ for (const Node* output : node->out_nodes()) {
+ if (output->IsMerge()) {
+ merge_nodes.insert(output);
+ }
+ }
}
}