From 49bfb8ab97e6b4019f0ee8cdb41ca30d0eda6226 Mon Sep 17 00:00:00 2001 From: "gengchao4@huawei.com" Date: Wed, 14 Apr 2021 17:39:04 +0800 Subject: [PATCH] bugfix for nopadding reuse --- ge/graph/build/memory/graph_mem_assigner.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index c3721554..119904ab 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -1700,6 +1700,10 @@ void GraphMemoryAssigner::PrintMemoryOffset() { ge::Status GraphMemoryAssigner::TryGetNodeRefIndexes(const NodePtr &node, map &out2ins) const{ for (const auto &out_data_anchor : node->GetAllOutDataAnchors()) { int32_t reuse_in_index = -1; + if (GraphUtils::IsNoPaddingRefFromInput(out_data_anchor, reuse_in_index)) { + out2ins.emplace(out_data_anchor->GetIdx(), reuse_in_index); + return ge::SUCCESS; + } bool reuse_input_flag = GraphUtils::IsRefFromInput(out_data_anchor, reuse_in_index); if (reuse_input_flag) { if (node->GetInDataAnchor(reuse_in_index) != nullptr) {