fix arithemtic bug

This commit is contained in:
Yang Jiao 2022-11-17 10:51:04 +08:00
parent e13930eb33
commit f726904a8b
1 changed files with 2 additions and 2 deletions

View File

@ -628,8 +628,6 @@ bool ArithmeticSimplify::DoArithmeticTrans(const inner::LiteGraphPtr &litegraph)
// get the new node to replace // get the new node to replace
inner::NodePtr alter_graph_node = cur_pattern->AlterGraph(para_to_ref, const_to_ref, *iter); inner::NodePtr alter_graph_node = cur_pattern->AlterGraph(para_to_ref, const_to_ref, *iter);
(*iter)->ReplaceWith(alter_graph_node); (*iter)->ReplaceWith(alter_graph_node);
ops_list = litegraph->GetOrderedNodes();
iter = ops_list.rbegin();
changed = true; changed = true;
break; break;
} }
@ -637,6 +635,8 @@ bool ArithmeticSimplify::DoArithmeticTrans(const inner::LiteGraphPtr &litegraph)
} }
if (!can_simplify) { if (!can_simplify) {
++iter; ++iter;
} else {
break;
} }
} }
return changed; return changed;