From 1c44a6edbeefb6af8084815d35a7b32d21ce3a39 Mon Sep 17 00:00:00 2001 From: laiyongqiang Date: Fri, 22 May 2020 16:54:38 +0800 Subject: [PATCH] don't eliminate nop node in getnext-memcpy elimination --- .../ascend/enhancer/getnext_memcpy_elimination.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc b/mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc index f747321721..6d0906363e 100644 --- a/mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc +++ b/mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc @@ -56,9 +56,12 @@ const AnfNodePtr GetnextMemcpyElimination::Process(const FuncGraphPtr &graph, co return nullptr; } - // 3. next_node has only one input which is memcpy's output + // 3. next_node is not nop node and it has only one input which is memcpy's output for (auto &item : next_nodes) { auto next_node = item.first->cast(); + if (opt::IsNopNode(next_node)) { + return nullptr; + } if (next_node->inputs().size() != 2) { MS_LOG(DEBUG) << "next node has more than one input"; return nullptr;