提交 7336ed94 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5395 fix assign memory error in pynative mode

Merge pull request !5395 from chujinjin/fix_assign_memory_error_in_pynative
......@@ -339,8 +339,13 @@ void KernelRuntime::RunOpAssignOutputNodeMemory(const ValuePtr &pre_output_value
for (size_t i = 0; i < output_nodes.size(); ++i) {
auto output_node_with_index = AnfAlgo::VisitKernel(output_nodes[i], 0);
if (!output_node_with_index.first->isa<CNode>()) {
MS_LOG(EXCEPTION) << "The output node should be a cnode , but it is "
<< output_node_with_index.first->DebugString();
if (output_node_with_index.first->isa<Parameter>()) {
auto param = output_node_with_index.first->cast<ParameterPtr>();
if (!param->has_default()) {
MS_LOG(EXCEPTION) << "The output parameter should be real parameter!";
}
}
continue;
}
auto real_output_cnode = output_node_with_index.first->cast<CNodePtr>();
MS_EXCEPTION_IF_NULL(real_output_cnode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册