From 19c1a68ee9d73e24205ce05265ac4c24e60552cc Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Tue, 10 Apr 2018 22:20:25 +0800 Subject: [PATCH] Fix lost of LoD while splitting tensor in parallel executor. --- paddle/fluid/framework/parallel_executor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 99b3065d8d..f393105fe8 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -181,10 +181,10 @@ void ParallelExecutor::SplitTensorToPlaces( member_->places_.size(), lod_tensors.size()); for (size_t j = 0; j < member_->places_.size(); ++j) { // TODO(panxy0718): Do I need to delete this var? - member_->local_scopes_[j] - ->Var(it.first) - ->GetMutable() - ->ShareDataWith(lod_tensors[j]); + auto t = + member_->local_scopes_[j]->Var(it.first)->GetMutable(); + t->ShareDataWith(lod_tensors[j]); + t->set_lod(lod_tensors[j].lod()); } } } -- GitLab