diff --git a/src/operators/dropout_op.cpp b/src/operators/dropout_op.cpp index 1b2295a9c3c403cf2404fda6be691f715a33c5b8..f59c838b92b17fd4b1e040310940cb03df8a2eda 100644 --- a/src/operators/dropout_op.cpp +++ b/src/operators/dropout_op.cpp @@ -28,8 +28,8 @@ template class DropoutOp; namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU -USE_OP(Dropout); -REGISTER_OPERATOR(dropout, ops::DropoutOp); +USE_OP_CPU(Dropout); +REGISTER_OPERATOR_CPU(dropout, ops::DropoutOp); #endif #ifdef PADDLE_MOBILE_MALI_GPU #endif diff --git a/src/operators/dropout_op.h b/src/operators/dropout_op.h index 380071dba280f2ebc6a42f46e3155bcce6fc2a49..245160d18e1a16d0073258a8fb9c367eae6cf797 100644 --- a/src/operators/dropout_op.h +++ b/src/operators/dropout_op.h @@ -30,13 +30,14 @@ using paddle_mobile::framework::Tensor; template class DropoutOp : public framework::OperatorWithKernel< - DeviceType, DropoutParam, operators::DropoutKernal> { + DeviceType, DropoutParam, operators::DropoutKernel> { public: DropoutOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, attrs, - scope), + : framework::OperatorWithKernel>( + type, inputs, outputs, attrs, scope), param_(inputs, outputs, attrs, *scope) {} using framework::OperatorWithKernel; namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU -USE_OP(im2sequence); -REGISTER_OPERATOR(im2sequence, ops::Im2SequenceOp); +USE_OP_CPU(im2sequence); +REGISTER_OPERATOR_CPU(im2sequence, ops::Im2SequenceOp); #endif #ifdef PADDLE_MOBILE_MALI_GPU #endif diff --git a/src/operators/im2sequence_op.h b/src/operators/im2sequence_op.h index 0b0085e4cec48741b25485e6dc3fc0fcc33e53d1..9ecd76d567df956843f12f1cbd2b6451df750b55 100644 --- a/src/operators/im2sequence_op.h +++ b/src/operators/im2sequence_op.h @@ -28,14 +28,16 @@ using namespace framework; template class Im2SequenceOp : public framework::OperatorWithKernel< DeviceType, Im2SequenceParam, - operators::Im2SequenceKernal> { + operators::Im2SequenceKernel> { public: Im2SequenceOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, attrs, - scope), + : framework::OperatorWithKernel< + DeviceType, Im2SequenceParam, + operators::Im2SequenceKernel>(type, inputs, outputs, + attrs, scope), param_(inputs, outputs, attrs, *scope) {} using framework::OperatorWithKernel< diff --git a/src/operators/kernel/arm/dropout_kernel.cpp b/src/operators/kernel/arm/dropout_kernel.cpp index 868723be22361b660d24169faf9f001a59f503b2..ea682809fbbd63c29aa162075d1f7fe1e03a96e0 100644 --- a/src/operators/kernel/arm/dropout_kernel.cpp +++ b/src/operators/kernel/arm/dropout_kernel.cpp @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#ifdef DROPOUT_OP + #pragma once #include "operators/kernel/dropout_kernel.h" @@ -43,3 +45,5 @@ void DropoutKernel::Compute(const DropoutParam ¶m) const { } } // namespace operators } // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/arm/im2sequence_kernel.cpp b/src/operators/kernel/arm/im2sequence_kernel.cpp index 0a4873d4d8f501fc8975e5ed461c8e137771d339..46833b1062ec0a4335dcdb452ae91b8f78f02df3 100644 --- a/src/operators/kernel/arm/im2sequence_kernel.cpp +++ b/src/operators/kernel/arm/im2sequence_kernel.cpp @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#ifdef IM2SEQUENCE_OP + #include "operators/kernel/im2sequence_kernel.h" namespace paddle_mobile { @@ -72,3 +74,5 @@ template class Im2SequenceKernel; } // namespace operators } // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/dropout_kernel.h b/src/operators/kernel/dropout_kernel.h index 42b914b175154c3300f2388e5ac1375536a5d747..7cf5ed28d67c568f5228d77865127d08bc0cf088 100644 --- a/src/operators/kernel/dropout_kernel.h +++ b/src/operators/kernel/dropout_kernel.h @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#ifdef DROPOUT_OP + #include "framework/operator.h" #include "operators/op_param.h" @@ -28,3 +30,5 @@ class DropoutKernel : public framework::OpKernelBase { }; } // namespace operators } // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/im2sequence_kernel.h b/src/operators/kernel/im2sequence_kernel.h index 0b02a7bd4d422479170bb066a48bbe91c0b92cec..0d211ff6b16f3f6e7ff265f3901b11c617213f61 100644 --- a/src/operators/kernel/im2sequence_kernel.h +++ b/src/operators/kernel/im2sequence_kernel.h @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#ifdef IM2SEQUENCE_OP + #include "framework/operator.h" #include "operators/math/im2col.h" #include "operators/math/math_function.h" @@ -34,3 +36,5 @@ class Im2SequenceKernel }; } // namespace operators } // namespace paddle_mobile + +#endif