diff --git a/src/operators/dropout_op.cpp b/src/operators/dropout_op.cpp index f59c838b92b17fd4b1e040310940cb03df8a2eda..ade81ac7fa0688a46f922c1a7f3823e17ebd5681 100644 --- a/src/operators/dropout_op.cpp +++ b/src/operators/dropout_op.cpp @@ -19,8 +19,8 @@ namespace operators { template void DropoutOp::InferShape() const { - auto input_dims = param_.InputX()->dims(); - param_.Out()->Resize(input_dims); + auto input_dims = thsi->param_.InputX()->dims(); + this->param_.Out()->Resize(input_dims); } template class DropoutOp; } // namespace operators @@ -28,7 +28,7 @@ template class DropoutOp; namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU -USE_OP_CPU(Dropout); +USE_OP_CPU(dropout); REGISTER_OPERATOR_CPU(dropout, ops::DropoutOp); #endif #ifdef PADDLE_MOBILE_MALI_GPU diff --git a/src/operators/dropout_op.h b/src/operators/dropout_op.h index 245160d18e1a16d0073258a8fb9c367eae6cf797..3fcafc331ae38a8db32bced3a19da559ea821ae4 100644 --- a/src/operators/dropout_op.h +++ b/src/operators/dropout_op.h @@ -37,11 +37,10 @@ class DropoutOp std::shared_ptr scope) : framework::OperatorWithKernel>( - type, inputs, outputs, attrs, scope), - param_(inputs, outputs, attrs, *scope) {} + type, inputs, outputs, attrs, scope) {} - using framework::OperatorWithKernel>; + //using framework::OperatorWithKernel>; void InferShape() const override; protected: diff --git a/src/operators/im2sequence_op.cpp b/src/operators/im2sequence_op.cpp index 2754540f0f6790ddc0756719aac18b12e58ad930..2cb2d6398f85f461bd6214e2631dd0a8f951fb2d 100644 --- a/src/operators/im2sequence_op.cpp +++ b/src/operators/im2sequence_op.cpp @@ -28,13 +28,13 @@ int Im2SequenceOutputSize(int input_size, int kernel, int padding_1, template void Im2SequenceOp::InferShape() const { - auto in_x_dims = param_.Input()->dims(); + auto in_x_dims = this->param_.Input()->dims(); - const std::vector &kernels = param_.Kernels(); + const std::vector &kernels = this->param_.Kernels(); - const std::vector &strides = param_.Strides(); + const std::vector &strides = this->param_.Strides(); - std::vector paddings = param_.Paddings(); + std::vector paddings = this->param_.Paddings(); std::vector output_shape({in_x_dims[0], in_x_dims[1]}); for (size_t i = 0; i < strides.size(); ++i) { @@ -44,7 +44,7 @@ void Im2SequenceOp::InferShape() const { } framework::DDim ddim = framework::make_ddim(output_shape); - param_.Output()->Resize(ddim); + this->param_.Output()->Resize(ddim); } template class Im2SequenceOp; diff --git a/src/operators/im2sequence_op.h b/src/operators/im2sequence_op.h index 9ecd76d567df956843f12f1cbd2b6451df750b55..7cc44298067691b81c4e7df6bd4601e35e29d7b8 100644 --- a/src/operators/im2sequence_op.h +++ b/src/operators/im2sequence_op.h @@ -37,12 +37,11 @@ class Im2SequenceOp : public framework::OperatorWithKernel< : framework::OperatorWithKernel< DeviceType, Im2SequenceParam, operators::Im2SequenceKernel>(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} + attrs, scope) {} - using framework::OperatorWithKernel< - DeviceType, Im2SequenceParam, - operators::Im2SequenceKernel>::OperatorWithKernel; + //using framework::OperatorWithKernel< + // DeviceType, Im2SequenceParam, + // operators::Im2SequenceKernel>::OperatorWithKernel; void InferShape() const override; private: diff --git a/src/operators/kernel/arm/dropout_kernel.cpp b/src/operators/kernel/arm/dropout_kernel.cpp index ea682809fbbd63c29aa162075d1f7fe1e03a96e0..af16048a1b4eba2ff36f842b6cf968031989576e 100644 --- a/src/operators/kernel/arm/dropout_kernel.cpp +++ b/src/operators/kernel/arm/dropout_kernel.cpp @@ -23,7 +23,7 @@ namespace paddle_mobile { namespace operators { template <> -bool DropoutKernel::Init(const DropoutParam ¶) const { +bool DropoutKernel::Init(DropoutParam *para) { return true; } diff --git a/src/operators/kernel/arm/im2sequence_kernel.cpp b/src/operators/kernel/arm/im2sequence_kernel.cpp index 46833b1062ec0a4335dcdb452ae91b8f78f02df3..709fa30a23d4efba3531d9bc567c99f53875bc12 100644 --- a/src/operators/kernel/arm/im2sequence_kernel.cpp +++ b/src/operators/kernel/arm/im2sequence_kernel.cpp @@ -20,7 +20,7 @@ namespace paddle_mobile { namespace operators { template <> -bool Im2SequenceKernel::Init(const Im2SequenceParam ¶) const { +bool Im2SequenceKernel::Init(Im2SequenceParam *para) { return true; } diff --git a/src/operators/kernel/dropout_kernel.h b/src/operators/kernel/dropout_kernel.h index 7cf5ed28d67c568f5228d77865127d08bc0cf088..0b217d7d315bb56e3996427d3839f033c8484231 100644 --- a/src/operators/kernel/dropout_kernel.h +++ b/src/operators/kernel/dropout_kernel.h @@ -26,7 +26,7 @@ template class DropoutKernel : public framework::OpKernelBase { public: void Compute(const DropoutParam& param) const; - bool Init(const DropoutParam& para) const; + bool Init(DropoutParam *para); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/im2sequence_kernel.h b/src/operators/kernel/im2sequence_kernel.h index 0d211ff6b16f3f6e7ff265f3901b11c617213f61..1c3249dda73918a2f2cdb301de06a68e7e63ed6b 100644 --- a/src/operators/kernel/im2sequence_kernel.h +++ b/src/operators/kernel/im2sequence_kernel.h @@ -32,7 +32,7 @@ class Im2SequenceKernel : public framework::OpKernelBase { public: void Compute(const Im2SequenceParam ¶m) const; - bool Init(const Im2SequenceParam ¶) const; + bool Init(Im2SequenceParam* para); }; } // namespace operators } // namespace paddle_mobile diff --git a/tools/op.cmake b/tools/op.cmake index 8c9182f900ac4e180f30e3fb3f16015b034e4458..8ddf739b5fc112ba0fa588d4d5b354ceaeb8ebde 100644 --- a/tools/op.cmake +++ b/tools/op.cmake @@ -156,6 +156,6 @@ endif() if (DROPOUT_OP) add_definitions(-DDROPOUT_OP) endif() -if (IM2SQUENCE_OP) - add_definitions(-DIM2SQUENCE_OP) +if (IM2SEQUENCE_OP) + add_definitions(-DIM2SEQUENCE_OP) endif()