未验证 提交 fb0cadfd 编写于 作者: F From00 提交者: GitHub

Fix bug for prepare phi OP (#40033)

上级 acdf0663
...@@ -186,11 +186,10 @@ PreparedOp PrepareImpl(const NameVarMap<VarType>& ins, ...@@ -186,11 +186,10 @@ PreparedOp PrepareImpl(const NameVarMap<VarType>& ins,
<< " | kernel key: " << pt_kernel_key << " | kernel key: " << pt_kernel_key
<< " | kernel: " << pt_kernel; << " | kernel: " << pt_kernel;
if (platform::is_cpu_place(expected_kernel_key.place_)) { if (expected_kernel_key.place_ != place) {
auto* cpu_ctx = pool.Get(paddle::platform::CPUPlace()); dev_ctx = pool.Get(expected_kernel_key.place_);
return PreparedOp(op, ctx, expected_kernel_key, pt_kernel_signature,
pt_kernel, cpu_ctx);
} }
// TODO(chenweihang): using CPUKernel when miss device kernel case // TODO(chenweihang): using CPUKernel when miss device kernel case
return PreparedOp(op, ctx, expected_kernel_key, pt_kernel_signature, return PreparedOp(op, ctx, expected_kernel_key, pt_kernel_signature,
pt_kernel, dev_ctx); pt_kernel, dev_ctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册