fix bug of identity and noop

This commit is contained in:
jiaorui 2023-01-31 09:20:16 +08:00
parent be8c4e12d3
commit 8456a762e5
1 changed files with 2 additions and 2 deletions

View File

@ -2236,7 +2236,7 @@ void DfGraphConvertor::RemoveIdentity(::ge::GNode identity_node) {
void DfGraphConvertor::IdentityOptimization() {
MS_LOG(INFO) << "Start IdentityOptimization, graph: " << anf_graph_->ToString();
MS_EXCEPTION_IF_NULL(df_graph_);
auto all_nodes = df_graph_->GetAllNodes();
auto all_nodes = df_graph_->GetDirectNode();
for (const auto &node : all_nodes) {
if (IsIdentityRedundant(node)) {
RemoveIdentity(node);
@ -2248,7 +2248,7 @@ void DfGraphConvertor::IdentityOptimization() {
void DfGraphConvertor::NoOpOptimization() {
MS_LOG(INFO) << "Start NoOpOptimization, graph:" << anf_graph_->ToString();
MS_EXCEPTION_IF_NULL(df_graph_);
auto all_nodes = df_graph_->GetAllNodes();
auto all_nodes = df_graph_->GetDirectNode();
for (const auto &node : all_nodes) {
if (IsNoOpRedundant(node)) {
RemoveNoOp(node);