Browse Source

don't eliminate nop node in getnext-memcpy elimination

tags/v0.3.0-alpha
laiyongqiang 5 years ago
parent
commit
1c44a6edbe
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc

+ 4
- 1
mindspore/ccsrc/pre_activate/ascend/enhancer/getnext_memcpy_elimination.cc View File

@@ -56,9 +56,12 @@ const AnfNodePtr GetnextMemcpyElimination::Process(const FuncGraphPtr &graph, co
return nullptr; 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) { for (auto &item : next_nodes) {
auto next_node = item.first->cast<CNodePtr>(); auto next_node = item.first->cast<CNodePtr>();
if (opt::IsNopNode(next_node)) {
return nullptr;
}
if (next_node->inputs().size() != 2) { if (next_node->inputs().size() != 2) {
MS_LOG(DEBUG) << "next node has more than one input"; MS_LOG(DEBUG) << "next node has more than one input";
return nullptr; return nullptr;


Loading…
Cancel
Save