Skip to content

Commit b64dde2

Browse files
author
Yang Yang
committed
fix share tensor
1 parent 6f7b346 commit b64dde2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

paddle/operators/parallel_do_op.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,13 @@ class ParallelDoGradOp : public framework::OperatorBase {
247247
auto *tmp = sub_scopes[0]->Var(&tmp_name);
248248

249249
for (size_t i = 1; i < sub_scopes.size(); ++i) {
250-
if (!(places[i] == places[0])) {
251-
CopyOrShare(*sub_scopes[i]->FindVar(s), places[0], tmp);
252-
WaitOnPlace(places[0]);
253-
}
250+
CopyOrShare(*sub_scopes[i]->FindVar(s), places[0], tmp);
251+
WaitOnPlace(places[0]);
254252

255253
auto sum_op = framework::OpRegistry::CreateOp(
256254
"sum", {{"X", {s, tmp_name}}}, {{"Out", {s}}},
257255
framework::AttributeMap{});
256+
VLOG(3) << sum_op->DebugStringEx(sub_scopes[0]);
258257
sum_op->Run(*sub_scopes[0], places[0]);
259258
WaitOnPlace(places[0]);
260259
}

0 commit comments

Comments
 (0)