From 6f527e0cd26d6d8c9ff607686f695cfaf63fd2fa Mon Sep 17 00:00:00 2001 From: kswang Date: Thu, 3 Sep 2020 22:05:42 +0800 Subject: [PATCH] fix release tensor exception --- mindspore/ccsrc/backend/session/executor.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mindspore/ccsrc/backend/session/executor.cc b/mindspore/ccsrc/backend/session/executor.cc index bff938496e4..e50fb3d4d37 100644 --- a/mindspore/ccsrc/backend/session/executor.cc +++ b/mindspore/ccsrc/backend/session/executor.cc @@ -141,17 +141,20 @@ void Executor::WorkerLoop() { } catch (const std::exception &e) { exception_ptr_ = std::current_exception(); } - if (task->type_ == kCompileNodes) { + + auto task_type = task->type_; + task = nullptr; + if (task_type == kCompileNodes) { compile_cond_var_.notify_all(); - } else if (task->type_ == kCompileGraph) { + } else if (task_type == kCompileGraph) { compile_cond_var_.notify_all(); - } else if (task->type_ == kBuildGraph) { + } else if (task_type == kBuildGraph) { build_cond_var_.notify_all(); - } else if (task->type_ == kRunGraph) { + } else if (task_type == kRunGraph) { run_cond_var_.notify_all(); - } else if (task->type_ == kBuildOp) { + } else if (task_type == kBuildOp) { build_op_cond_var_.notify_all(); - } else if (task->type_ == kRunOp) { + } else if (task_type == kRunOp) { run_op_cond_var_.notify_all(); } }