From f3210b60ba3a5f23cfed95148c44e5d5db298f35 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Fri, 18 Jan 2019 15:49:32 +0800 Subject: [PATCH] fix copy_memory and share_memory --- paddle/fluid/framework/parallel_executor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 4173b39e10d..3997294f172 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -419,13 +419,13 @@ void ParallelExecutor::BCastParamsToDevices( auto local_scope = member_->local_scopes_[i]; auto *t = local_scope->Var(var)->GetMutable(); - auto share_memory = [&] { + auto copy_memory = [&] { t->Resize(dims); t->mutable_data(cpu, main_tensor.type()); paddle::framework::TensorCopy(main_tensor, cpu, t); }; - auto copy_memory = [&] { t->ShareDataWith(main_tensor); }; + auto share_memory = [&] { t->ShareDataWith(main_tensor); }; // FIXME(zcd): LR_DECAY_COUNTER should not be shared. This is a hot fix. if (member_->build_strategy_.async_mode_) { -- GitLab