Browse Source

!2715 Vm no process empty graph

Merge pull request !2715 from zhoufeng/empty-graph-not-process
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
c5f2e4d80a
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      mindspore/ccsrc/session/ascend_session.cc

+ 6
- 0
mindspore/ccsrc/session/ascend_session.cc View File

@@ -289,6 +289,12 @@ GraphId AscendSession::CompileGraph(NotNull<FuncGraphPtr> func_graph) {
std::vector<KernelGraphPtr> all_graphs;
auto root_graph = ConstructKernelGraph(func_graph, &all_graphs);
BackendOptimization(all_graphs);
// empty graph dont entry to backend
if (root_graph->execution_order().empty()) {
MS_LOG(INFO) << root_graph->ToString() << " is empty graph.";
InitRuntimeResource();
return root_graph->graph_id();
}
// split switch
SplitGraphs(NOT_NULL(root_graph));
// insert goto labels and label_sets


Loading…
Cancel
Save