code review part9

This commit is contained in:
xuanyue 2021-10-09 16:54:13 +08:00
parent 509c2cb399
commit 175c8e6cc0
3 changed files with 9 additions and 9 deletions

View File

@ -75,7 +75,7 @@ bool PassManager::Run(const FuncGraphPtr &func_graph, const std::vector<PassPtr>
#endif
num++;
} else {
MS_LOG(INFO) << "pass " << pass->name() << "is null";
MS_LOG(INFO) << "pass is null";
}
}
return changed;

View File

@ -59,12 +59,12 @@ const AnfNodePtr AffineActivationFusion::Process(const FuncGraphPtr &func_graph,
return nullptr;
}
auto affine_node = pre_node->cast<CNodePtr>();
if (IsMarkedTrainOp(affine_node)) {
if (affine_node == nullptr) {
MS_LOG(ERROR) << "the affine_node is null.";
lite::ReturnCode::GetSingleReturnCode()->UpdateReturnCode(lite::RET_NULL_PTR);
return nullptr;
}
if (pre_node == nullptr) {
MS_LOG(ERROR) << "the splice_node is null.";
lite::ReturnCode::GetSingleReturnCode()->UpdateReturnCode(lite::RET_NULL_PTR);
if (IsMarkedTrainOp(affine_node)) {
return nullptr;
}
auto affine_prim = GetValueNode<std::shared_ptr<ops::Affine>>(affine_node->input(kAnfPrimitiveIndex));

View File

@ -68,14 +68,14 @@ const AnfNodePtr AffineFusion::Process(const FuncGraphPtr &func_graph, const Anf
return nullptr;
}
auto splice_node = pre_node->cast<CNodePtr>();
if (IsMarkedTrainOp(splice_node)) {
return nullptr;
}
if (pre_node == nullptr) {
if (splice_node == nullptr) {
MS_LOG(ERROR) << "the splice_node is null.";
lite::ReturnCode::GetSingleReturnCode()->UpdateReturnCode(lite::RET_NULL_PTR);
return nullptr;
}
if (IsMarkedTrainOp(splice_node)) {
return nullptr;
}
auto splice_prim = GetValueNode<std::shared_ptr<ops::Splice>>(splice_node->input(kAnfPrimitiveIndex));
MS_ASSERT(prim != nullptr);
/**