move root_scope->DropKids() into Finalize() so that we do not have to drop all the kids

test=develop
revert-16555-model_data_cryption_link_all_lib
dongdaxiang 6 years ago
parent be74de2c61
commit ba15d6b164

@ -73,6 +73,7 @@ void DistMultiTrainer::Finalize() {
}
pull_dense_worker_->Stop();
dataset_ptr_->DestroyReaders();
root_scope_->DropKids();
}
} // end namespace framework

@ -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;
}

@ -76,6 +76,7 @@ void MultiTrainer::Finalize() {
th.join();
}
dataset_ptr_->DestroyReaders();
root_scope_->DropKids();
}
} // end namespace framework

Loading…
Cancel
Save