!7993 delete sub_graph_changed

Merge pull request !7993 from ZengZitao/delete_sub_graph_changed
This commit is contained in:
mindspore-ci-bot 2020-10-30 10:59:59 +08:00 committed by Gitee
commit 8e5d76d632
1 changed files with 1 additions and 5 deletions

View File

@ -37,6 +37,7 @@ AnfNodePtr NewCNodeWithInfo(const AnfNodePtrList &inputs, const AnfNodePtr &ori_
} else {
ResetKernelInfo(new_cnode, UNKNOWN_KERNEL_TYPE);
}
func_graph->AddNode(new_cnode);
return new_cnode;
}
@ -768,17 +769,12 @@ bool ArithmeticSimplify::Run(const FuncGraphPtr &func_graph) {
mng_sub = Manage(sub_graph, false);
sub_graph->set_manager(mng_sub);
}
bool sub_graph_changed = false;
for (auto node_sub : sub_graph->GetOrderedCnodes()) {
auto new_node = TrySimplify(node_sub);
if (new_node != nullptr) {
sub_graph_changed = true;
PERFORM_REPLACE(node_sub->cast<AnfNodePtr>(), new_node, sub_graph, replaced);
}
}
if (sub_graph_changed) {
ResetKernelInfo(node, AKG_KERNEL);
}
} else {
auto new_node = TrySimplify(node);
PERFORM_REPLACE(node->cast<AnfNodePtr>(), new_node, func_graph, replaced);