Skip to content

Commit 91f3ea4

Browse files
authored
Update put_along_axis_grad_kernel.cc (#73049)
1 parent d2777ec commit 91f3ea4

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

paddle/phi/kernels/cpu/put_along_axis_grad_kernel.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ void PutAlongAxisGradKernel(const Context& dev_ctx,
3535
bool include_self,
3636
DenseTensor* x_grad,
3737
DenseTensor* value_grad) {
38-
PADDLE_ENFORCE_EQ(
39-
dev_ctx.GetPlace().GetType() == phi::AllocationType::CPU,
40-
true,
41-
errors::PreconditionNotMet("PutAlongAxisGradOpKernel only runs on CPU."));
42-
4338
const auto& index_type = index.dtype();
4439
if (x_grad) {
4540
phi::Copy(dev_ctx, out_grad, dev_ctx.GetPlace(), false, x_grad);

paddle/phi/kernels/cpu/put_along_axis_kernel.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ void PutAlongAxisKernel(const Context& dev_ctx,
3232
const std::string& reduce,
3333
bool include_self,
3434
DenseTensor* out) {
35-
PADDLE_ENFORCE_EQ(
36-
dev_ctx.GetPlace().GetType() == phi::AllocationType::CPU,
37-
true,
38-
errors::PreconditionNotMet("PutAlongAxisOpKernel only runs on CPU."));
39-
4035
phi::Copy(dev_ctx, x, dev_ctx.GetPlace(), false, out);
4136
const auto& index_type = index.dtype();
4237
if (reduce == "add") {

0 commit comments

Comments
 (0)