forked from mindspore-Ecosystem/mindspore
!341 solve the problem input0 of cnode is not a value node
Merge pull request !341 from chenfei/handle-cnode-input0-is-cnode
This commit is contained in:
commit
dada71eec3
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue