diff --git a/paddle/operators/math/maxouting.cc b/paddle/operators/math/maxouting.cc index c8c1974f79a94563e930caebe63790bb1d5adc17..bcd4da612c841e241b63e62ce19e7c5f4a7db2d5 100644 --- a/paddle/operators/math/maxouting.cc +++ b/paddle/operators/math/maxouting.cc @@ -89,6 +89,7 @@ public: if (input_data[input_idx] == output_data[output_idx]) { input_grad_data[input_idx] += output_grad_data[output_idx]; continue_match = false; + break; } } } diff --git a/paddle/operators/math/maxouting.cu b/paddle/operators/math/maxouting.cu index 3a0600fd8465e5183ded3775afb459f27e3da0bf..0a8afbbaca3a793b62bc37fd5997a0f6213661f5 100644 --- a/paddle/operators/math/maxouting.cu +++ b/paddle/operators/math/maxouting.cu @@ -65,6 +65,7 @@ __global__ void KernelMaxoutGrad( if (input_data[data_idx + g * feat_len] == output_data[i]) { max_index = data_idx + g * feat_len; continue_match = false; + break; } } if (max_index != -1) { diff --git a/paddle/operators/maxout_op.cu.cc b/paddle/operators/maxout_op.cu.cc index 3e6debf69960be1a7ebd2c00505b31ec7484c40a..5ee431cb26cde12a620808fb07dbd26843c64bc5 100644 --- a/paddle/operators/maxout_op.cu.cc +++ b/paddle/operators/maxout_op.cu.cc @@ -17,6 +17,11 @@ namespace ops = paddle::operators; REGISTER_OP_GPU_KERNEL(maxout, ops::MaxOutKernel); +REGISTER_OP_GPU_KERNEL(maxout, ops::MaxOutKernel); REGISTER_OP_GPU_KERNEL(maxout_grad, ops::MaxOutGradKernel); +REGISTER_OP_GPU_KERNEL(maxout_grad, + ops::MaxOutGradKernel);