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

Fix bug for prepare phi OP (#40033)

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