From 28c21fe68a8064dff3597337bceb706fcd6273ed Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Tue, 19 Sep 2017 17:28:32 +0800 Subject: [PATCH] Fix compile error in prelu_op. --- paddle/operators/prelu_op.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/paddle/operators/prelu_op.h b/paddle/operators/prelu_op.h index ece2a836a65..63031c25cc3 100644 --- a/paddle/operators/prelu_op.h +++ b/paddle/operators/prelu_op.h @@ -54,8 +54,8 @@ class PReluKernel : public framework::OpKernel { int numel = x->numel(); - auto place = context.GetPlace(); - Transform(place, x_ptr, x_ptr + numel, o_ptr, PReluFunctor(alpha_ptr)); + Transform(context.device_context(), x_ptr, x_ptr + numel, o_ptr, + PReluFunctor(alpha_ptr)); } }; @@ -91,9 +91,8 @@ class PReluGradKernel : public framework::OpKernel { const T* out_ptr = out->data(); int numel = dx->numel(); - auto place = context.GetPlace(); - Transform(place, out_ptr, out_ptr + numel, dout_ptr, dx_ptr, - PReluGradFunctor(alpha_ptr)); + Transform(context.device_context(), out_ptr, out_ptr + numel, dout_ptr, + dx_ptr, PReluGradFunctor(alpha_ptr)); // TODO (Zhuoyuan): add dalpha upgrade when GPU kernels ready } -- GitLab