From ba15d6b164f644a07e13d486b8057d5cadd0b1a5 Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Sun, 24 Mar 2019 09:37:26 +0800 Subject: [PATCH] move root_scope->DropKids() into Finalize() so that we do not have to drop all the kids test=develop --- paddle/fluid/framework/dist_multi_trainer.cc | 1 + paddle/fluid/framework/executor.cc | 2 -- paddle/fluid/framework/multi_trainer.cc | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/dist_multi_trainer.cc b/paddle/fluid/framework/dist_multi_trainer.cc index 636e0a735..481e12fcd 100644 --- a/paddle/fluid/framework/dist_multi_trainer.cc +++ b/paddle/fluid/framework/dist_multi_trainer.cc @@ -73,6 +73,7 @@ void DistMultiTrainer::Finalize() { } pull_dense_worker_->Stop(); dataset_ptr_->DestroyReaders(); + root_scope_->DropKids(); } } // end namespace framework diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 501480876..239a3ce0a 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -143,8 +143,6 @@ void Executor::RunFromDataset(const ProgramDesc& main_program, Scope* scope, trainer->Run(); VLOG(3) << "Trainer going to finalize"; trainer->Finalize(); - VLOG(3) << "Drop current scope kids"; - scope->DropKids(); return; } diff --git a/paddle/fluid/framework/multi_trainer.cc b/paddle/fluid/framework/multi_trainer.cc index 409c2f435..3a266e4bd 100644 --- a/paddle/fluid/framework/multi_trainer.cc +++ b/paddle/fluid/framework/multi_trainer.cc @@ -76,6 +76,7 @@ void MultiTrainer::Finalize() { th.join(); } dataset_ptr_->DestroyReaders(); + root_scope_->DropKids(); } } // end namespace framework -- GitLab