未验证 提交 b95eb38b 编写于 作者: J JamesLim 提交者: GitHub

fix the bug in backward OP of index_sample. (#31026)

上级 6b3371e0
...@@ -55,7 +55,7 @@ __global__ void IndexSampleGrad(const IndexT* index, T* in_grad, ...@@ -55,7 +55,7 @@ __global__ void IndexSampleGrad(const IndexT* index, T* in_grad,
platform::CudaAtomicAdd(&(in_grad[in_idx - index_i + sample_idx]), platform::CudaAtomicAdd(&(in_grad[in_idx - index_i + sample_idx]),
out_grad[sample_idx]); out_grad[sample_idx]);
} else { } else {
in_grad[in_idx - index_i + sample_idx] = out_grad[sample_idx]; in_grad[in_idx - index_i + sample_idx] = out_grad[index_idx];
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册