Skip to content

Commit 20f202a

Browse files
authored
Merge pull request #9824 from wanghaoshuang/fix_parall_exe
Fix lost of LoD while splitting tensor in parallel executor.
2 parents cea3912 + 19c1a68 commit 20f202a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/fluid/framework/parallel_executor.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ void ParallelExecutor::SplitTensorToPlaces(
181181
member_->places_.size(), lod_tensors.size());
182182
for (size_t j = 0; j < member_->places_.size(); ++j) {
183183
// TODO(panxy0718): Do I need to delete this var?
184-
member_->local_scopes_[j]
185-
->Var(it.first)
186-
->GetMutable<LoDTensor>()
187-
->ShareDataWith(lod_tensors[j]);
184+
auto t =
185+
member_->local_scopes_[j]->Var(it.first)->GetMutable<LoDTensor>();
186+
t->ShareDataWith(lod_tensors[j]);
187+
t->set_lod(lod_tensors[j].lod());
188188
}
189189
}
190190
}

0 commit comments

Comments
 (0)