Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
ec3bb70c
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ec3bb70c
编写于
6月 11, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
for
上级
c93b7403
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
276 addition
and
61 deletion
+276
-61
CMakeLists.txt
CMakeLists.txt
+13
-1
src/framework/op_registry.h
src/framework/op_registry.h
+59
-10
src/framework/operator.cpp
src/framework/operator.cpp
+5
-0
src/framework/operator.h
src/framework/operator.h
+2
-0
src/operators/batchnorm_op.cpp
src/operators/batchnorm_op.cpp
+9
-2
src/operators/box_coder_op.cpp
src/operators/box_coder_op.cpp
+8
-2
src/operators/concat_op.cpp
src/operators/concat_op.cpp
+9
-2
src/operators/conv_op.cpp
src/operators/conv_op.cpp
+14
-2
src/operators/depthwise_conv_op.cpp
src/operators/depthwise_conv_op.cpp
+8
-2
src/operators/elementwise_add_op.cpp
src/operators/elementwise_add_op.cpp
+8
-2
src/operators/feed_op.h
src/operators/feed_op.h
+8
-2
src/operators/fetch_op.h
src/operators/fetch_op.h
+8
-2
src/operators/fusion_conv_add.cpp
src/operators/fusion_conv_add.cpp
+8
-2
src/operators/fusion_conv_add.h
src/operators/fusion_conv_add.h
+7
-1
src/operators/fusion_conv_add_relu_op.h
src/operators/fusion_conv_add_relu_op.h
+8
-2
src/operators/fusion_fc_op.cpp
src/operators/fusion_fc_op.cpp
+8
-2
src/operators/fusion_fc_op.h
src/operators/fusion_fc_op.h
+7
-2
src/operators/kernel/fpga/conv_kernel.cpp
src/operators/kernel/fpga/conv_kernel.cpp
+6
-5
src/operators/lrn_op.cpp
src/operators/lrn_op.cpp
+8
-2
src/operators/mul_op.cpp
src/operators/mul_op.cpp
+8
-2
src/operators/multiclass_nms_op.cpp
src/operators/multiclass_nms_op.cpp
+8
-2
src/operators/pool_op.cpp
src/operators/pool_op.cpp
+8
-2
src/operators/prior_box_op.cpp
src/operators/prior_box_op.cpp
+8
-2
src/operators/relu_op.cpp
src/operators/relu_op.cpp
+8
-2
src/operators/reshape_op.cpp
src/operators/reshape_op.cpp
+8
-2
src/operators/sigmoid_op.cpp
src/operators/sigmoid_op.cpp
+8
-2
src/operators/softmax_op.cpp
src/operators/softmax_op.cpp
+8
-2
src/operators/transpose_op.cpp
src/operators/transpose_op.cpp
+9
-2
未找到文件。
CMakeLists.txt
浏览文件 @
ec3bb70c
cmake_minimum_required
(
VERSION 3.0
)
project
(
paddle-mobile
)
option
(
DEBUGING
"enable debug mode"
O
FF
)
option
(
DEBUGING
"enable debug mode"
O
N
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
ON
)
option
(
CPU
"cpu"
ON
)
option
(
MALI_GPU
"mali gpu"
OFF
)
option
(
FPGA
"fpga"
ON
)
if
(
CPU
)
add_definitions
(
-DPADDLE_MOBILE_CPU
)
elseif
(
MALI_GPU
)
add_definitions
(
-DPADDLE_MOBILE_MALI_GPU
)
elseif
(
FPGA
)
add_definitions
(
-DPADDLE_MOBILE_FPGA
)
endif
()
if
(
DEBUGING
)
set
(
CMAKE_BUILD_TYPE Debug
)
else
()
...
...
src/framework/op_registry.h
浏览文件 @
ec3bb70c
...
...
@@ -96,24 +96,73 @@ class OpRegistry {
}
};
#define REGISTER_OPERATOR(op_type, op_class) \
#ifdef PADDLE_MOBILE_CPU
#define REGISTER_OPERATOR_CPU(op_type, op_class) \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_ : public op_class<Dtype, T> { \
class _OpClass_##op_type##_
cpu
: public op_class<Dtype, T> { \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_, op_class); \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_
cpu
, op_class); \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__(#op_type); \
int TouchOpRegistrar_##op_type() { \
__op_registrar_##op_type##__.Touch(); \
paddle_mobile::CPU, _OpClass_##op_type##_
cpu
<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__
cpu
(#op_type); \
int TouchOpRegistrar_##op_type
##_cpu
() { \
__op_registrar_##op_type##__
cpu
.Touch(); \
return 0; \
}
#define USE_OP(op_type) \
extern int TouchOpRegistrar_##op_type(); \
#define USE_OP
_CPU
(op_type) \
extern int TouchOpRegistrar_##op_type
##_cpu
(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type()
TouchOpRegistrar_##op_type##_cpu()
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_mali_gpu : public op_class<Dtype, T> { \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_mali_gpu, op_class); \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_mali_gpu<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__mali_gpu(#op_type); \
int TouchOpRegistrar_##op_type##_mali_gpu() { \
__op_registrar_##op_type##__mali_gpu.Touch(); \
return 0; \
}
#define USE_OP_MALI_GPU(op_type) \
extern int TouchOpRegistrar_##op_type##_mali_gpu(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_mali_gpu()
#endif
#ifdef PADDLE_MOBILE_FPGA
#define REGISTER_OPERATOR_FPGA(op_type, op_class) \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_fpga : public op_class<Dtype, T> { \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_fpga<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__fpga(#op_type); \
int TouchOpRegistrar_##op_type##_fpga() { \
__op_registrar_##op_type##__fpga.Touch(); \
return 0; \
}
#define USE_OP_FPGA(op_type) \
extern int TouchOpRegistrar_##op_type##_fpga(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_fpga()
#endif
}
// namespace framework
}
// namespace paddle_mobile
src/framework/operator.cpp
浏览文件 @
ec3bb70c
...
...
@@ -58,7 +58,12 @@ void OperatorBase<Dtype>::Run() const {
}
template
class
OperatorBase
<
CPU
>;
template
class
OperatorBase
<
FPGA
>;
template
class
OperatorBase
<
GPU_MALI
>;
template
class
OperatorWithKernel
<
CPU
>;
template
class
OperatorWithKernel
<
FPGA
>;
template
class
OperatorWithKernel
<
GPU_MALI
>;
}
// namespace framework
}
// namespace paddle_mobile
src/framework/operator.h
浏览文件 @
ec3bb70c
...
...
@@ -137,6 +137,7 @@ class OpKernelBase {
std::shared_ptr<::paddle_mobile::framework::Scope> scope) \
: parent_cls<Dtype, T>(type, inputs, outputs, attrs, scope) {}
class
FusionOpMatcher
{
public:
FusionOpMatcher
()
{}
...
...
@@ -153,6 +154,7 @@ class FusionOpMatcher {
std
::
string
BeginType
()
{
return
node_
.
Type
();
}
// virtual bool Fusion();
protected:
Node
node_
;
std
::
string
type_
;
...
...
src/operators/batchnorm_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -31,7 +31,14 @@ template class BatchNormOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
batch_norm
);
REGISTER_OPERATOR
(
batch_norm
,
ops
::
BatchNormOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
batch_norm
);
REGISTER_OPERATOR_CPU
(
batch_norm
,
ops
::
BatchNormOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/box_coder_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -52,7 +52,13 @@ template class BoxCoderOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
box_coder
);
REGISTER_OPERATOR
(
box_coder
,
ops
::
BoxCoderOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
box_coder
);
REGISTER_OPERATOR_CPU
(
box_coder
,
ops
::
BoxCoderOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/concat_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -61,8 +61,15 @@ template class ConcatOp<CPU, float>;
}
// namespace operators
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
concat
);
REGISTER_OPERATOR
(
concat
,
ops
::
ConcatOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
concat
);
REGISTER_OPERATOR_CPU
(
concat
,
ops
::
ConcatOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/conv_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -53,7 +53,19 @@ template class ConvOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
conv2d
);
REGISTER_OPERATOR
(
conv2d
,
ops
::
ConvOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
conv2d
);
REGISTER_OPERATOR_CPU
(
conv2d
,
ops
::
ConvOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
USE_OP_MALI_GPU
(
conv2d
);
REGISTER_OPERATOR_MALI_GPU
(
conv2d
,
ops
::
ConvOp
);
#endif
#ifdef PADDLE_MOBILE_FPGA
USE_OP_FPGA
(
conv2d
);
REGISTER_OPERATOR_FPGA
(
conv2d
,
ops
::
ConvOp
);
#endif
#endif
src/operators/depthwise_conv_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -54,7 +54,13 @@ template class DepthwiseConvOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
depthwise_conv2d
);
REGISTER_OPERATOR
(
depthwise_conv2d
,
ops
::
DepthwiseConvOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
depthwise_conv2d
);
REGISTER_OPERATOR_CPU
(
depthwise_conv2d
,
ops
::
DepthwiseConvOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/elementwise_add_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -29,7 +29,13 @@ template class ElementwiseAddOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
elementwise_add
);
REGISTER_OPERATOR
(
elementwise_add
,
ops
::
ElementwiseAddOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
elementwise_add
);
REGISTER_OPERATOR_CPU
(
elementwise_add
,
ops
::
ElementwiseAddOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/feed_op.h
浏览文件 @
ec3bb70c
...
...
@@ -43,8 +43,14 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
};
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
feed
);
REGISTER_OPERATOR
(
feed
,
ops
::
FeedOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
feed
);
REGISTER_OPERATOR_CPU
(
feed
,
ops
::
FeedOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace paddle_mobile
src/operators/fetch_op.h
浏览文件 @
ec3bb70c
...
...
@@ -43,8 +43,14 @@ class FetchOp : public framework::OperatorBase<DeviceType> {
};
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
fetch
);
REGISTER_OPERATOR
(
fetch
,
ops
::
FetchOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
fetch
);
REGISTER_OPERATOR_CPU
(
fetch
,
ops
::
FetchOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace paddle_mobile
src/operators/fusion_conv_add.cpp
浏览文件 @
ec3bb70c
...
...
@@ -25,7 +25,13 @@ template class FushionConvAddOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
conv_add
);
REGISTER_OPERATOR
(
conv_add
,
ops
::
FushionConvAddOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
conv_add
);
REGISTER_OPERATOR_CPU
(
conv_add
,
ops
::
FushionConvAddOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/fusion_conv_add.h
浏览文件 @
ec3bb70c
...
...
@@ -64,7 +64,13 @@ class FushionConvAddOp : public framework::OperatorWithKernel<DeviceType> {
// FushionFcParam param_;
};
// static framework::FusionOpRegistrar fc_registrar(new FusionConvAddMatcher());
#ifdef PADDLE_MOBILE_CPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionConvAddMatcher
());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace paddle_mobile
...
...
src/operators/fusion_conv_add_relu_op.h
浏览文件 @
ec3bb70c
...
...
@@ -46,8 +46,14 @@ class ConvAddReluOp {
private:
};
// static framework::FusionOpRegistrar fc_registrar(
// new FushionConvAddReluOpMatcher());
#ifdef PADDLE_MOBILE_CPU
//static framework::FusionOpRegistrar fusion_conv_add_relu_registrar(
// new FushionConvAddReluOpMatcher());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace paddle_mobile
...
...
src/operators/fusion_fc_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -54,7 +54,13 @@ template class FushionFcOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
fc
);
REGISTER_OPERATOR
(
fc
,
ops
::
FushionFcOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
fc
);
REGISTER_OPERATOR_CPU
(
fc
,
ops
::
FushionFcOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/fusion_fc_op.h
浏览文件 @
ec3bb70c
...
...
@@ -37,8 +37,6 @@ class FusionFcMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}},
removed_nodes
);
}
...
...
@@ -69,7 +67,14 @@ class FushionFcOp : public framework::OperatorWithKernel<DeviceType> {
FushionFcParam
param_
;
};
#ifdef PADDLE_MOBILE_CPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionFcMatcher
());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionFcMatcher
());
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace paddle_mobile
...
...
src/operators/kernel/fpga/conv_kernel.cpp
浏览文件 @
ec3bb70c
...
...
@@ -14,14 +14,15 @@ limitations under the License. */
#ifdef CONV_OP
#include "operators/kernel/conv_kernel.h"
namespace
paddle_mobile
{
namespace
operators
{
// template<>
// void ConvKernel<FPGA, float>::Compute(const ConvParam ¶m) const
// {}
//
// template class ConvKernel<FPGA, float>;
template
<
>
void
ConvKernel
<
FPGA
,
float
>::
Compute
(
const
ConvParam
&
param
)
const
{}
template
class
ConvKernel
<
FPGA
,
float
>;
}
}
// namespace paddle_mobile
...
...
src/operators/lrn_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -29,7 +29,13 @@ template class LrnOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
lrn
);
REGISTER_OPERATOR
(
lrn
,
ops
::
LrnOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
lrn
);
REGISTER_OPERATOR_CPU
(
lrn
,
ops
::
LrnOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/mul_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -55,7 +55,13 @@ template class MulOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
mul
);
REGISTER_OPERATOR
(
mul
,
ops
::
MulOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
mul
);
REGISTER_OPERATOR_CPU
(
mul
,
ops
::
MulOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/multiclass_nms_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -39,7 +39,13 @@ template class MultiClassNMSOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
multiclass_nms
);
REGISTER_OPERATOR
(
multiclass_nms
,
ops
::
MultiClassNMSOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
multiclass_nms
);
REGISTER_OPERATOR_CPU
(
multiclass_nms
,
ops
::
MultiClassNMSOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/pool_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -59,7 +59,13 @@ template class PoolOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
pool2d
);
REGISTER_OPERATOR
(
pool2d
,
ops
::
PoolOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
pool2d
);
REGISTER_OPERATOR_CPU
(
pool2d
,
ops
::
PoolOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/prior_box_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -49,7 +49,13 @@ template class PriorBoxOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
prior_box
);
REGISTER_OPERATOR
(
prior_box
,
ops
::
PriorBoxOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
prior_box
);
REGISTER_OPERATOR_CPU
(
prior_box
,
ops
::
PriorBoxOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/relu_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -33,7 +33,13 @@ template class ReluOp<CPU, float>;
* 都是需要和model中类型对应起来的
* */
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
relu
);
REGISTER_OPERATOR
(
relu
,
ops
::
ReluOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
relu
);
REGISTER_OPERATOR_CPU
(
relu
,
ops
::
ReluOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/reshape_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -32,7 +32,13 @@ template class ReshapeOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
reshape
);
REGISTER_OPERATOR
(
reshape
,
ops
::
ReshapeOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
reshape
);
REGISTER_OPERATOR_CPU
(
reshape
,
ops
::
ReshapeOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/sigmoid_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -27,7 +27,13 @@ template class SigmoidOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
sigmoid
);
REGISTER_OPERATOR
(
sigmoid
,
ops
::
SigmoidOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
sigmoid
);
REGISTER_OPERATOR_CPU
(
sigmoid
,
ops
::
SigmoidOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/softmax_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -27,7 +27,13 @@ template class SoftmaxOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
softmax
);
REGISTER_OPERATOR
(
softmax
,
ops
::
SoftmaxOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
softmax
);
REGISTER_OPERATOR_CPU
(
softmax
,
ops
::
SoftmaxOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
src/operators/transpose_op.cpp
浏览文件 @
ec3bb70c
...
...
@@ -52,7 +52,14 @@ template class TransposeOp<CPU, float>;
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
transpose
);
REGISTER_OPERATOR
(
transpose
,
ops
::
TransposeOp
);
#ifdef PADDLE_MOBILE_CPU
USE_OP_CPU
(
transpose
);
REGISTER_OPERATOR_CPU
(
transpose
,
ops
::
TransposeOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录