未验证 提交 c173887e 编写于 作者: Q QingshuChen 提交者: GitHub

fix softmax bug for multi_card in kunlun (#30600) (#30614)

上级 fd9d6fda
...@@ -46,7 +46,7 @@ class SoftmaxXPUKernel : public framework::OpKernel<T> { ...@@ -46,7 +46,7 @@ class SoftmaxXPUKernel : public framework::OpKernel<T> {
Tensor clip_x; Tensor clip_x;
int len = x->numel(); int len = x->numel();
T* clip_x_data = T* clip_x_data =
clip_x.mutable_data<T>(platform::XPUPlace(), len * sizeof(T)); clip_x.mutable_data<T>(context.GetPlace(), len * sizeof(T));
r = xpu::clip(dev_ctx.x_context(), x->data<float>(), clip_x_data, len, r = xpu::clip(dev_ctx.x_context(), x->data<float>(), clip_x_data, len,
-1e30, 1e30); -1e30, 1e30);
PADDLE_ENFORCE_EQ(r, XPU_SUCCESS, PADDLE_ENFORCE_EQ(r, XPU_SUCCESS,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册