|
|
|
@@ -405,6 +405,14 @@ bool IsNopNode(const AnfNodePtr &node) { |
|
|
|
} |
|
|
|
CNodePtr cnode = node->cast<CNodePtr>(); |
|
|
|
MS_EXCEPTION_IF_NULL(cnode); |
|
|
|
if (cnode->inputs().empty()) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
auto input0 = cnode->input(0); |
|
|
|
MS_EXCEPTION_IF_NULL(input0); |
|
|
|
if (!input0->isa<ValueNode>()) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
bool is_nop_node = false; |
|
|
|
if (AnfAlgo::HasNodeAttr("nop_op", cnode)) { |
|
|
|
is_nop_node = AnfAlgo::GetNodeAttr<bool>(cnode, "nop_op"); |
|
|
|
|