From 61f9f136fd257ff0aeb16ddfb4c41cffa6664650 Mon Sep 17 00:00:00 2001 From: kangguangli Date: Thu, 9 Feb 2023 11:31:11 +0800 Subject: [PATCH] [BugFix][ConditionalBlock] fix judgement about scope validation (#50086) * fix judgement about scope validation * fix ci bug: same address is not enough for data consistency * remove useless check --- .../operators/controlflow/conditional_block_op.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/paddle/fluid/operators/controlflow/conditional_block_op.cc b/paddle/fluid/operators/controlflow/conditional_block_op.cc index f11bf6612c..f44a93e0c3 100644 --- a/paddle/fluid/operators/controlflow/conditional_block_op.cc +++ b/paddle/fluid/operators/controlflow/conditional_block_op.cc @@ -78,17 +78,8 @@ class ConditionalBlockOp : public ConditionalOp { "got a null Scope variable. Please set the Scope variable.")); auto *scopes = scope_var->GetMutable>(); - - if (scopes->size() == 0 || !FLAGS_control_flow_use_new_executor) { - scopes->resize(1); - scopes->front() = &scope.NewScope(); - } - - // We need to know whether the scope we cached is still valid. - // If not, we need to create a new one. - if (scope.kids().size() == 0) { - scopes->front() = &scope.NewScope(); - } + scopes->resize(1); + scopes->front() = &scope.NewScope(); auto &cur_scope = *scopes->front(); #ifdef PADDLE_WITH_MKLDNN -- GitLab