@@ -163,12 +163,11 @@ class ParallelDoOp : public framework::OperatorBase {
163
163
auto &place = places[place_idx];
164
164
auto *cur_scope = sub_scopes[place_idx];
165
165
166
- workers.emplace_back (
167
- framework::Async ([program, cur_scope, place, block, place_idx] {
168
- framework::Executor executor (place);
169
- executor.Run (*program, cur_scope, block->ID (),
170
- false /* create_local_scope*/ );
171
- }));
166
+ workers.emplace_back (framework::Async ([program, cur_scope, place, block] {
167
+ framework::Executor executor (place);
168
+ executor.Run (*program, cur_scope, block->ID (),
169
+ false /* create_local_scope*/ );
170
+ }));
172
171
}
173
172
for (auto &worker : workers) {
174
173
worker.wait ();
@@ -239,12 +238,11 @@ class ParallelDoGradOp : public framework::OperatorBase {
239
238
auto *cur_scope = sub_scopes[i];
240
239
241
240
// execute
242
- workers.emplace_back (
243
- framework::Async ([program, cur_scope, place, block, i] {
244
- framework::Executor executor (place);
245
- executor.Run (*program, cur_scope, block->ID (),
246
- false /* create_local_scope*/ );
247
- }));
241
+ workers.emplace_back (framework::Async ([program, cur_scope, place, block] {
242
+ framework::Executor executor (place);
243
+ executor.Run (*program, cur_scope, block->ID (),
244
+ false /* create_local_scope*/ );
245
+ }));
248
246
}
249
247
for (auto &worker : workers) {
250
248
worker.wait ();
0 commit comments