diff --git a/paddle/phi/kernels/gpu/index_select_grad_kernel.cu b/paddle/phi/kernels/gpu/index_select_grad_kernel.cu index 2fce40dbe7306a127ec9435bf0c4ca5c8d40e0b9..64e3428cc9aaf82e624dfc90d699c5db990612eb 100644 --- a/paddle/phi/kernels/gpu/index_select_grad_kernel.cu +++ b/paddle/phi/kernels/gpu/index_select_grad_kernel.cu @@ -87,7 +87,7 @@ void IndexSelectGradKernel(const Context& ctx, auto stream = ctx.stream(); unsigned int block_dim = PADDLE_CUDA_NUM_THREADS; - dim3 grid_dim = dim3((numel + block_dim - 1) / block_dim); + dim3 grid_dim = dim3((out_nums + block_dim - 1) / block_dim); phi::backends::gpu::LimitGridDim(ctx, &grid_dim); phi::funcs::SetConstant index_select_grad_init;