提交 734fabb7 编写于 作者: C chenfei

solve problem when create parameter from 'call' cnode

上级 9c9c7091
......@@ -822,7 +822,7 @@ GraphId AscendSession::GetGraphIdByNode(const AnfNodePtr &front_anf) const {
}
}
MS_EXCEPTION_IF_NULL(front_anf);
MS_LOG(WARNING) << "front_anf " << front_anf->DebugString() << " is not exist in any graph";
MS_LOG(DEBUG) << "front_anf " << front_anf->DebugString() << " is not exist in any graph";
return kInvalidGraphId;
}
......
......@@ -264,7 +264,11 @@ std::vector<AnfNodePtr> CreateParameterFromTuple(const AnfNodePtr &node, bool va
MS_EXCEPTION_IF_NULL(node);
MS_EXCEPTION_IF_NULL(graph);
std::vector<AnfNodePtr> parameters;
std::vector<AnfNodePtr> pre_graph_out = AnfAlgo::GetAllOutput(node, {prim::kPrimTupleGetItem});
std::vector<AnfNodePtr> pre_graph_out = {node};
// If a cnode is a call, it's input0 is a cnode too, so it doesn't have primitive
if (!AnfAlgo::IsRealKernel(node)) {
pre_graph_out = AnfAlgo::GetAllOutput(node, {prim::kPrimTupleGetItem});
}
auto valid_inputs = graph->MutableValidInputs();
MS_EXCEPTION_IF_NULL(valid_inputs);
auto graph_inputs = graph->MutableInputs();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册