!12434 fix operator_info is null

From: @Margaret_wangrui
Reviewed-by: 
Signed-off-by:
This commit is contained in:
mindspore-ci-bot 2021-02-23 14:19:19 +08:00 committed by Gitee
commit 2c5d19260e
1 changed files with 4 additions and 0 deletions

View File

@ -2250,6 +2250,10 @@ LossNodeInfo FindLossCNode(const FuncGraphPtr &func_graph) {
}
AnfNodePtr pre_node = return_node->input(1);
MS_EXCEPTION_IF_NULL(pre_node);
if (IsPrimitiveCNode(pre_node, prim::kPrimDepend)) {
pre_node = pre_node->cast<CNodePtr>()->input(1);
MS_EXCEPTION_IF_NULL(pre_node);
}
auto pre_cnode = pre_node->cast<CNodePtr>();
if (pre_cnode == nullptr || !IsValueNode<Primitive>(pre_cnode->input(0))) {