diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 94c61461c060f9f80ce06a931520e4c9dae5c798..bc9035b302d760979fddfc41ec8ec83edd0ceae2 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -193,7 +193,8 @@ struct FetchOpHandle : public OpHandle { void Run() override { for (auto *input : inputs_) { - input->generated_op_->Wait(nullptr); + auto *var = static_cast(input); + var->generated_op_->Wait(this->dev_ctx_[var->place_]); } tensors_.resize(inputs_.size());