forked from mindspore-Ecosystem/mindspore
!8183 Fix fullname when CNode is call node; Modify the log level of GetLoopNodesByDFS.
Merge pull request !8183 from Margaret_wangrui/fix_fullname
This commit is contained in:
commit
4b52bad287
|
@ -302,20 +302,20 @@ void KernelGraph::GetLoopNodesByDFS(AnfNodePtr node, uint32_t *loop_num) {
|
|||
} else {
|
||||
AnfNodePtr node_iter = node;
|
||||
MS_EXCEPTION_IF_NULL(node_iter);
|
||||
MS_LOG(DEBUG) << "Print loop nodes start:";
|
||||
MS_LOG(INFO) << "Print loop nodes start:";
|
||||
for (; node_iter != input_edge.first && node_iter != nullptr; node_iter = edge_to_[node_iter]) {
|
||||
loop_nodes_.push(node_iter);
|
||||
node_input_num_[node_iter]--;
|
||||
MS_LOG(DEBUG) << "Get loop node:" << node_iter->DebugString();
|
||||
MS_LOG(INFO) << "Get loop node:" << node_iter->DebugString();
|
||||
}
|
||||
if (node_iter != nullptr) {
|
||||
loop_nodes_.push(node_iter);
|
||||
loop_nodes_.push(node);
|
||||
(*loop_num)++;
|
||||
node_input_num_[node_iter]--;
|
||||
MS_LOG(DEBUG) << "Get loop node:" << node_iter->DebugString();
|
||||
MS_LOG(DEBUG) << "Get loop node:" << node->DebugString();
|
||||
MS_LOG(DEBUG) << "Print loop nodes end, Loop num:" << *loop_num;
|
||||
MS_LOG(INFO) << "Get loop node:" << node_iter->DebugString();
|
||||
MS_LOG(INFO) << "Get loop node:" << node->DebugString();
|
||||
MS_LOG(INFO) << "Print loop nodes end, Loop num:" << *loop_num;
|
||||
while (!loop_nodes_.empty()) {
|
||||
loop_nodes_.pop();
|
||||
}
|
||||
|
|
|
@ -866,13 +866,20 @@ void SessionBasic::CreateCNodeKernelGraph(const AnfNodePtr node, KernelGraphPtr
|
|||
auto new_cnode = CreateNewCNode(cnode, graph.get());
|
||||
MS_EXCEPTION_IF_NULL(new_cnode);
|
||||
new_cnode->set_abstract(cnode->abstract());
|
||||
new_cnode->set_fullname_with_scope(cnode->fullname_with_scope());
|
||||
std::string fullname;
|
||||
if (cnode->input(kAnfPrimitiveIndex)->isa<CNode>()) {
|
||||
fullname = cnode->input(kAnfPrimitiveIndex)->fullname_with_scope();
|
||||
} else {
|
||||
fullname = cnode->fullname_with_scope();
|
||||
}
|
||||
new_cnode->set_fullname_with_scope(fullname);
|
||||
new_cnode->set_scope(cnode->scope());
|
||||
graph->FrontBackendlMapAdd(node, new_cnode);
|
||||
if (AnfAlgo::CheckPrimitiveType(new_cnode, prim::kPrimReturn)) {
|
||||
graph->set_return(new_cnode);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<KernelGraph> SessionBasic::ConstructKernelGraph(const FuncGraphPtr &func_graph,
|
||||
std::vector<KernelGraphPtr> *all_out_graph) {
|
||||
MS_EXCEPTION_IF_NULL(func_graph);
|
||||
|
|
Loading…
Reference in New Issue