diff options
author | 2017-06-28 10:16:51 -0700 | |
---|---|---|
committer | 2017-06-28 10:21:16 -0700 | |
commit | 6233d8a75c17bedc2b082f6ef32fb150ac2b28b9 (patch) | |
tree | dd0b1416bde8ff6f3c96523c4ab649bfa9689933 /tensorflow | |
parent | 9a45d4d6bab843424c3994798fc7fa4e1e04db56 (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.cc | 8 |
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); + } + } } } |