未验证 提交 103f4c32 编写于 作者: Z zmxdream 提交者: GitHub

Fix incorrect size of grid dimension in index_select (#54660) (#54740)

Co-authored-by: NLeo Chen <39020268+leo0519@users.noreply.github.com>
上级 558ae9cd
...@@ -87,7 +87,7 @@ void IndexSelectGradKernel(const Context& ctx, ...@@ -87,7 +87,7 @@ void IndexSelectGradKernel(const Context& ctx,
auto stream = ctx.stream(); auto stream = ctx.stream();
unsigned int block_dim = PADDLE_CUDA_NUM_THREADS; 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::backends::gpu::LimitGridDim(ctx, &grid_dim);
phi::funcs::SetConstant<phi::GPUContext, T> index_select_grad_init; phi::funcs::SetConstant<phi::GPUContext, T> index_select_grad_init;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册