提交 5b03cddc 编写于 作者: Y Yao,kun

Add marco

上级 1060a1d7
......@@ -28,8 +28,8 @@ template class DropoutOp<CPU, float>;
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
......
......@@ -30,13 +30,14 @@ using paddle_mobile::framework::Tensor;
template <typename DeviceType, typename T>
class DropoutOp
: public framework::OperatorWithKernel<
DeviceType, DropoutParam, operators::DropoutKernal<DeviceType, T>> {
DeviceType, DropoutParam, operators::DropoutKernel<DeviceType, T>> {
public:
DropoutOp(const std::string &type, const VariableNameMap &inputs,
const VariableNameMap &outputs, const framework::AttributeMap attrs,
std::shared_ptr<framework::Scope> scope)
: framework::OperatorWithKernel<DeviceType>(type, inputs, outputs, attrs,
scope),
: framework::OperatorWithKernel<DeviceType, DropoutParam,
operators::DropoutKernel<DeviceType, T>>(
type, inputs, outputs, attrs, scope),
param_(inputs, outputs, attrs, *scope) {}
using framework::OperatorWithKernel<DeviceType, DropoutParam,
......
......@@ -54,8 +54,8 @@ template class Im2SequenceOp<CPU, float>;
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
......
......@@ -28,14 +28,16 @@ using namespace framework;
template <typename DeviceType, typename T>
class Im2SequenceOp : public framework::OperatorWithKernel<
DeviceType, Im2SequenceParam,
operators::Im2SequenceKernal<DeviceType, T>> {
operators::Im2SequenceKernel<DeviceType, T>> {
public:
Im2SequenceOp(const std::string &type, const VariableNameMap &inputs,
const VariableNameMap &outputs,
const framework::AttributeMap &attrs,
std::shared_ptr<framework::Scope> scope)
: framework::OperatorWithKernel<DeviceType>(type, inputs, outputs, attrs,
scope),
: framework::OperatorWithKernel<
DeviceType, Im2SequenceParam,
operators::Im2SequenceKernel<DeviceType, T>>(type, inputs, outputs,
attrs, scope),
param_(inputs, outputs, attrs, *scope) {}
using framework::OperatorWithKernel<
......
......@@ -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<CPU, float>::Compute(const DropoutParam &param) const {
}
} // namespace operators
} // namespace paddle_mobile
#endif
......@@ -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<CPU, float>;
} // namespace operators
} // namespace paddle_mobile
#endif
......@@ -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<DeviceType, DropoutParam> {
};
} // namespace operators
} // namespace paddle_mobile
#endif
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册