!8652 fix memory leak in pynative memory

From: @chujinjin
Reviewed-by: @kisnwang,@jjfeing
Signed-off-by: @jjfeing
This commit is contained in:
mindspore-ci-bot 2020-11-17 20:17:05 +08:00 committed by Gitee
commit e2e532dec3
1 changed files with 1 additions and 0 deletions

View File

@ -1985,6 +1985,7 @@ void PynativeExecutor::Clear(const std::string &flag) {
graph_info_map_.clear();
op_id_map_.clear();
obj_to_forward_id_.clear();
node_abs_map_.clear();
std::stack<FuncGraphPtr>().swap(graph_context_);
ConfigManager::GetInstance().ResetIterNum();
}