Browse Source

copy ref map to final graph in RecurseCompileGraph

tags/v0.6.0-beta
Margaret_wangrui 5 years ago
parent
commit
7676043baf
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      mindspore/ccsrc/session/ascend_session.cc

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

@@ -1727,6 +1727,14 @@ void AscendSession::RecurseCompileGraph(NotNull<KernelGraphPtr> graph, const Not
continue;
}
RecurseCompileGraph(NOT_NULL(child_graph), memo);
// copy ref map to final graph
auto child_ref_map = child_graph->GetRefMap();
for (auto &item : child_ref_map) {
if (graph->IsInRefOutputMap(item.first)) {
MS_LOG(EXCEPTION) << "The ref pair is already in final graph!";
}
graph->AddRefCorrespondPairs(item.first, item.second);
}
}
}
} // namespace session


Loading…
Cancel
Save