!2414 reset pynative flag in the resource clear

Merge pull request !2414 from limingqi107/master
This commit is contained in:
mindspore-ci-bot 2020-06-22 17:08:53 +08:00 committed by Gitee
commit be635d6100
1 changed files with 5 additions and 0 deletions

View File

@ -937,6 +937,11 @@ void PynativeExecutor::Clear(const std::string &flag) {
if (flag == "resource") {
MS_LOG(INFO) << "Clear res";
Clean();
// Maybe exit in the pynative runing op, so need reset pynative flag.
auto ms_context = MsContext::GetInstance();
if (ms_context != nullptr) {
ms_context->set_enable_pynative_infer(false);
}
return;
}
MS_LOG(INFO) << "Clear";