From d9679121e4f8194994b4dfc45e0af5f65e01ef92 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Nov 2020 20:09:17 +0800 Subject: [PATCH] Fix HandleMemoryRWConflict remove identity on while subgraph. --- ge/graph/optimize/mem_rw_conflict_optimize.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ge/graph/optimize/mem_rw_conflict_optimize.cc b/ge/graph/optimize/mem_rw_conflict_optimize.cc index 98024de2..b9533588 100644 --- a/ge/graph/optimize/mem_rw_conflict_optimize.cc +++ b/ge/graph/optimize/mem_rw_conflict_optimize.cc @@ -680,6 +680,11 @@ Status GraphOptimize::HandleMemoryRWConflict(ComputeGraphPtr &compute_graph) { } // 2.loop all node, including node in subgraph and handle memory rw conflict for (auto &node : compute_graph->GetAllNodes()) { + // ignore while subgraph node + const auto parent_node = node->GetOwnerComputeGraph()->GetParentNode(); + if ((parent_node != nullptr) && (kWhileOpTypes.count(parent_node->GetType()) > 0)) { + continue; + } // ignore data / netoutput of subgraph if (node->GetType() == DATA && AttrUtils::HasAttr(node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX)) { continue;