forked from huawei/mindspore2022
Only release runtime resource in GRAPH_MODE
This commit is contained in:
parent
f6ad679ef9
commit
6c491b8d3e
|
|
@ -712,6 +712,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue