提交 41271f03 编写于 作者: Q qijun

fix gpu build error

上级 fd5aa2ad
...@@ -19,10 +19,10 @@ namespace ops = paddle::operators; ...@@ -19,10 +19,10 @@ namespace ops = paddle::operators;
REGISTER_OP_GPU_KERNEL(sigmoid, REGISTER_OP_GPU_KERNEL(sigmoid,
ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::SigmoidFunctor>); ops::SigmoidFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
sigmoid_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, sigmoid_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::SigmoidGradFunctor>); ops::SigmoidGradFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
exp, exp,
...@@ -37,35 +37,27 @@ REGISTER_OP_GPU_KERNEL( ...@@ -37,35 +37,27 @@ REGISTER_OP_GPU_KERNEL(
relu_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, relu_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::ReluGradFunctor<float>>); ops::ReluGradFunctor<float>>);
REGISTER_OP(tanh, ops::ActivationOp, ops::TanhOpMaker, tanh_grad, REGISTER_OP_GPU_KERNEL(
ops::ActivationOpGrad); tanh,
REGISTER_OP_GPU_KERNEL(tanh, ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::TanhFunctor>);
ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::TanhFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
tanh_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, tanh_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::TanhGradFunctor<float>>); ops::TanhGradFunctor<float>>);
REGISTER_OP(sqrt, ops::ActivationOp, ops::SqrtOpMaker, sqrt_grad, REGISTER_OP_GPU_KERNEL(
ops::ActivationOpGrad); sqrt,
REGISTER_OP_GPU_KERNEL(sqrt, ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::SqrtFunctor>);
ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::SqrtFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
sqrt_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, sqrt_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::SqrtGradFunctor<float>>); ops::SqrtGradFunctor<float>>);
REGISTER_OP(abs, ops::ActivationOp, ops::AbsOpMaker, abs_grad,
ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(abs,
ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::AbsFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
abs_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, abs,
ops::AbsGradFunctor<float>>); ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::AbsFunctor>);
REGISTER_OP_GPU_KERNEL(abs_grad,
ops::ActivationGradKernel<paddle::platform::GPUPlace,
float, ops::AbsGradFunctor>);
REGISTER_OP(reciprocal, ops::ActivationOp, ops::ReciprocalOpMaker,
reciprocal_grad, ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(reciprocal, REGISTER_OP_GPU_KERNEL(reciprocal,
ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::ReciprocalFunctor<float>>); ops::ReciprocalFunctor<float>>);
...@@ -74,46 +66,34 @@ REGISTER_OP_GPU_KERNEL( ...@@ -74,46 +66,34 @@ REGISTER_OP_GPU_KERNEL(
ops::ActivationGradKernel<paddle::platform::GPUPlace, float, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::ReciprocalGradFunctor<float>>); ops::ReciprocalGradFunctor<float>>);
REGISTER_OP(log, ops::ActivationOp, ops::LogOpMaker, log_grad, REGISTER_OP_GPU_KERNEL(
ops::ActivationOpGrad); log,
REGISTER_OP_GPU_KERNEL(log, ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::LogFunctor>);
ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::LogFunctor<float>>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
log_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, log_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::LogGradFunctor<float>>); ops::LogGradFunctor<float>>);
REGISTER_OP(square, ops::ActivationOp, ops::SquareOpMaker, square_grad,
ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(square, REGISTER_OP_GPU_KERNEL(square,
ops::ActivationKernel<paddle::platform::GPUPlace, float, ops::ActivationKernel<paddle::platform::GPUPlace, float,
ops::squareFunctor<float>>); ops::SquareFunctor>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
square_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float, square_grad, ops::ActivationGradKernel<paddle::platform::GPUPlace, float,
ops::SquareGradFunctor<float>>); ops::SquareGradFunctor<float>>);
REGISTER_OP(brelu, ops::ActivationOp, ops::BReluOpMaker<float>, brelu_grad,
ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(brelu, REGISTER_OP_GPU_KERNEL(brelu,
ops::BReluKernel<paddle::platform::GPUPlace, float>); ops::BReluKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP_GPU_KERNEL(brelu_grad, REGISTER_OP_GPU_KERNEL(brelu_grad,
ops::BReluGradKernel<paddle::platform::GPUPlace, float>); ops::BReluGradKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP(soft_relu, ops::ActivationOp, ops::SoftReluOpMaker<float>,
soft_relu_grad, ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(soft_relu, REGISTER_OP_GPU_KERNEL(soft_relu,
ops::SoftReluKernel<paddle::platform::GPUPlace, float>); ops::SoftReluKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP_GPU_KERNEL( REGISTER_OP_GPU_KERNEL(
soft_relu_grad, ops::SoftReluGradKernel<paddle::platform::GPUPlace, float>); soft_relu_grad, ops::SoftReluGradKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP(pow, ops::ActivationOp, ops::PowOpMaker<float>, pow_grad,
ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(pow, ops::PowKernel<paddle::platform::GPUPlace, float>); REGISTER_OP_GPU_KERNEL(pow, ops::PowKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP_GPU_KERNEL(pow_grad, REGISTER_OP_GPU_KERNEL(pow_grad,
ops::PowGradKernel<paddle::platform::GPUPlace, float>); ops::PowGradKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP(stanh, ops::ActivationOp, ops::STanhOpMaker<float>, stanh_grad,
ops::ActivationOpGrad);
REGISTER_OP_GPU_KERNEL(stanh, REGISTER_OP_GPU_KERNEL(stanh,
ops::STanhKernel<paddle::platform::GPUPlace, float>); ops::STanhKernel<paddle::platform::GPUPlace, float>);
REGISTER_OP_GPU_KERNEL(stanh_grad, REGISTER_OP_GPU_KERNEL(stanh_grad,
......
...@@ -1406,7 +1406,7 @@ def inputs(layers, *args): ...@@ -1406,7 +1406,7 @@ def inputs(layers, *args):
if len(args) != 0: if len(args) != 0:
layers.extend(args) layers.extend(args)
Inputs(*[l.name for l in layers]) Inputs(* [l.name for l in layers])
def outputs(layers, *args): def outputs(layers, *args):
...@@ -1456,7 +1456,7 @@ def outputs(layers, *args): ...@@ -1456,7 +1456,7 @@ def outputs(layers, *args):
assert len(layers) > 0 assert len(layers) > 0
if HasInputsSet(): # input already set if HasInputsSet(): # input already set
Outputs(*[l.name for l in layers]) Outputs(* [l.name for l in layers])
return # just return outputs. return # just return outputs.
if len(layers) != 1: if len(layers) != 1:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册