!29523 Fix the problem that some abstracts is not updated caused by the call_graph_tuple_transform.

Merge pull request !29523 from liqiliang/fix_graph_transform
This commit is contained in:
i-robot 2022-01-26 01:45:39 +00:00 committed by Gitee
commit 9dc49bc766
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 3 deletions

View File

@ -95,7 +95,8 @@ AnfNodePtr TransformCallGraph(const FuncGraphPtr &trans_fg, const CNodePtr &cnod
}
}
auto new_node = fg->NewCNode(inputs);
new_node->set_abstract(cnode->abstract());
// Because the current pass involves the operation of changing the graph,
// so the abstract of this new_node cannot be set here, otherwise the Renormalize() will not be called.
return new_node;
}
@ -140,7 +141,8 @@ AnfNodePtr TransformSwitchCall(const AnfNodePtr &switch_node, const CNodePtr &cn
}
}
auto new_node = fg->NewCNode(inputs);
new_node->set_abstract(cnode->abstract());
// Because the current pass involves the operation of changing the graph,
// so the abstract of this new_node cannot be set here, otherwise the Renormalize() will not be called.
return new_node;
}
} // namespace opt

View File

@ -239,7 +239,7 @@ OptimizeIRPassLib::OptimizeIRPassLib() {
// tuple parameter graph transform
call_graph_tuple_transform_ =
MakeSubstitution(std::make_shared<CallGraphTupleTransform>(), "graph_param_transorm", IsCNode);
MakeSubstitution(std::make_shared<CallGraphTupleTransform>(), "graph_param_transform", IsCNode);
// RowTensor Eliminate
row_tensor_eliminate_ = MakeSubstitution(