!27806 enable closure in the control flow scene

Merge pull request !27806 from limingqi107/bug_fix4
This commit is contained in:
i-robot 2021-12-18 05:11:26 +00:00 committed by Gitee
commit 85fb569a4b
1 changed files with 5 additions and 2 deletions

View File

@ -744,8 +744,11 @@ bool TaskEmitAction(const ResourcePtr &res) {
if (res->func_graph() == nullptr) {
MS_LOG(EXCEPTION) << "TaskEmit args error";
}
// Disable mindRT in the control flow scenario.
ResetMindRTEnable(res);
auto closure_env = std::getenv("MS_DEV_ENABLE_CLOSURE");
if (closure_env == nullptr) {
// Disable mindRT in the control flow scenario.
ResetMindRTEnable(res);
}
FuncGraphPtr func_graph = res->func_graph();
MS_EXCEPTION_IF_NULL(func_graph);
auto bc_ptr = res->results()[kBackend].cast<compile::BackendPtr>();