From 5013c6764411bcd102d9909e970d7dfbd613f0c9 Mon Sep 17 00:00:00 2001 From: QingshuChen Date: Wed, 20 Jan 2021 20:16:26 +0800 Subject: [PATCH] fix softmax bug for multi_card in kunlun (#30600) --- 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