提交 90af5628 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1619 Only release runtime resource in GRAPH_MODE

Merge pull request !1619 from caifubi/fix-multi-graph-device-resource-bug
......@@ -719,6 +719,14 @@ void KernelGraph::UpdateCallRealInput() {
std::string KernelGraph::ToString() const { return std::string("kernel_graph_").append(std::to_string(graph_id_)); }
KernelGraph::~KernelGraph() { device::KernelRuntimeManager::Instance().ClearGraphResource(graph_id_); }
KernelGraph::~KernelGraph() {
auto context = MsContext::GetInstance();
if (!context) {
return;
}
if (context->execution_mode() == kGraphMode) {
device::KernelRuntimeManager::Instance().ClearGraphResource(graph_id_);
}
}
} // namespace session
} // namespace mindspore
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册