From 2dcc622d53ba103cea2ced973633cb9f1d0d81b7 Mon Sep 17 00:00:00 2001 From: jiangfan06 <117341294+MuShangCC@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:51:07 +0800 Subject: [PATCH] fix reduce.h (#54476) --- paddle/phi/kernels/xpu/reduce.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/phi/kernels/xpu/reduce.h b/paddle/phi/kernels/xpu/reduce.h index a9ba6c1ac13..1507024265e 100644 --- a/paddle/phi/kernels/xpu/reduce.h +++ b/paddle/phi/kernels/xpu/reduce.h @@ -78,7 +78,7 @@ int XPUReduce(const Context& dev_ctx, r = xpu::copy(dev_ctx.x_context(), reinterpret_cast(x_data), reinterpret_cast(y_data), - x.numel() * sizeof(T)); + x.numel()); PADDLE_ENFORCE_XDNN_SUCCESS(r, "copy"); } else { r = func(dev_ctx.x_context(), x_data, y_data, xdims, reduce_dims); @@ -100,7 +100,7 @@ void ReduceKernelImpl(const DeviceContext& dev_ctx, int r = xpu::copy(dev_ctx.x_context(), reinterpret_cast(x_data), reinterpret_cast(y_data), - input.numel() * sizeof(T)); + input.numel()); PADDLE_ENFORCE_XDNN_SUCCESS(r, "copy"); } else { Functor func; -- GitLab