Skip to content

Commit

Permalink
fix priority
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesqiao committed Jan 8, 2018
1 parent ca90356 commit 0b52cc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion paddle/framework/operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ void OperatorWithKernel::Run(const Scope& scope,
}
}

VLOG(3) << "expected_kernel_key:" << expected_kernel_key;

Scope& new_scope = scope.NewScope();

for (auto& var_name_item : this->Inputs()) {
Expand Down Expand Up @@ -520,7 +522,8 @@ void OperatorWithKernel::Run(const Scope& scope,

auto kernel_iter = kernels.find(expected_kernel_key);

kernel_iter->second->Compute(ExecutionContext(*this, new_scope, *dev_ctx));
kernel_iter->second->Compute(ExecutionContext(
*this, new_scope, *pool.Get(expected_kernel_key.place_)));
}

proto::DataType OperatorWithKernel::IndicateDataType(
Expand Down
2 changes: 1 addition & 1 deletion paddle/operators/fetch_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FetchOp : public framework::OperatorBase {
// FIXME(yuyang18): Should we assume the fetch operator always generate
// CPU outputs?
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance();
auto &dev_ctx = *pool.Get(place);
auto &dev_ctx = *pool.Get(src_item.place());

CopyFrom(src_item, platform::CPUPlace(), dev_ctx, &dst_item);
dev_ctx.Wait();
Expand Down

0 comments on commit 0b52cc8

Please sign in to comment.