From c173887e8ba192bd52f309c6a5c6aab6c7a93960 Mon Sep 17 00:00:00 2001 From: QingshuChen Date: Thu, 21 Jan 2021 11:47:01 +0800 Subject: [PATCH] fix softmax bug for multi_card in kunlun (#30600) (#30614) --- paddle/fluid/operators/softmax_op_xpu.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/softmax_op_xpu.cc b/paddle/fluid/operators/softmax_op_xpu.cc index 5d190189bf0..ed7034ef6ab 100644 --- a/paddle/fluid/operators/softmax_op_xpu.cc +++ b/paddle/fluid/operators/softmax_op_xpu.cc @@ -46,7 +46,7 @@ class SoftmaxXPUKernel : public framework::OpKernel { Tensor clip_x; int len = x->numel(); T* clip_x_data = - clip_x.mutable_data(platform::XPUPlace(), len * sizeof(T)); + clip_x.mutable_data(context.GetPlace(), len * sizeof(T)); r = xpu::clip(dev_ctx.x_context(), x->data(), clip_x_data, len, -1e30, 1e30); PADDLE_ENFORCE_EQ(r, XPU_SUCCESS, -- GitLab