!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:
mindspore-ci-bot 2020-04-15 19:29:49 +08:00 committed by Gitee
commit dada71eec3
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();