Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
e6302412
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看板
提交
e6302412
编写于
6月 15, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format files
上级
20d68051
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
176 addition
and
87 deletion
+176
-87
src/framework/operator.h
src/framework/operator.h
+5
-7
src/operators/batchnorm_op.h
src/operators/batchnorm_op.h
+6
-4
src/operators/box_coder_op.h
src/operators/box_coder_op.h
+9
-4
src/operators/concat_op.h
src/operators/concat_op.h
+10
-5
src/operators/conv_op.h
src/operators/conv_op.h
+9
-4
src/operators/depthwise_conv_op.h
src/operators/depthwise_conv_op.h
+11
-5
src/operators/elementwise_add_op.h
src/operators/elementwise_add_op.h
+11
-5
src/operators/fusion_conv_add.h
src/operators/fusion_conv_add.h
+9
-4
src/operators/fusion_fc_op.h
src/operators/fusion_fc_op.h
+11
-5
src/operators/kernel/arm/batchnorm_kernel.cpp
src/operators/kernel/arm/batchnorm_kernel.cpp
+1
-1
src/operators/kernel/mali/conv_kernel.cpp
src/operators/kernel/mali/conv_kernel.cpp
+2
-2
src/operators/lrn_op.h
src/operators/lrn_op.h
+9
-4
src/operators/mul_op.h
src/operators/mul_op.h
+8
-4
src/operators/multiclass_nms_op.h
src/operators/multiclass_nms_op.h
+11
-5
src/operators/pool_op.h
src/operators/pool_op.h
+8
-3
src/operators/prior_box_op.h
src/operators/prior_box_op.h
+9
-4
src/operators/relu_op.h
src/operators/relu_op.h
+9
-4
src/operators/reshape_op.h
src/operators/reshape_op.h
+9
-4
src/operators/sigmoid_op.h
src/operators/sigmoid_op.h
+9
-4
src/operators/softmax_op.h
src/operators/softmax_op.h
+9
-4
src/operators/transpose_op.h
src/operators/transpose_op.h
+11
-5
未找到文件。
src/framework/operator.h
浏览文件 @
e6302412
...
...
@@ -109,15 +109,15 @@ class OperatorWithKernel : public OperatorBase<Dtype> {
OperatorWithKernel
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
std
::
shared_ptr
<
Scope
>
scope
)
:
OperatorBase
<
Dtype
>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
){
:
OperatorBase
<
Dtype
>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
param_
(
inputs
,
outputs
,
attrs
,
*
scope
)
{
kernel_
.
Init
(
param_
);
}
virtual
void
RunImpl
()
const
{
this
->
kernel_
.
Compute
(
this
->
param_
);
}
virtual
void
RunImpl
()
const
{
this
->
kernel_
.
Compute
(
this
->
param_
);
}
virtual
void
InferShape
()
const
=
0
;
protected:
KernelType
kernel_
;
ParamType
param_
;
...
...
@@ -135,9 +135,7 @@ class OpKernelBase {
* 所有结构体存在与: paddle-mobile/src/operators/op_param.h
* */
virtual
void
Compute
(
const
P
&
para
)
const
=
0
;
virtual
bool
Init
(
const
P
&
para
)
const
{
return
true
;
};
virtual
bool
Init
(
const
P
&
para
)
const
{
return
true
;
};
virtual
~
OpKernelBase
()
=
default
;
};
...
...
src/operators/batchnorm_op.h
浏览文件 @
e6302412
...
...
@@ -25,15 +25,17 @@ namespace paddle_mobile {
namespace
operators
{
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
BatchNormOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
BatchNormParam
,
BatchNormKernel
<
DeviceType
,
T
>>
{
class
BatchNormOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
BatchNormParam
,
BatchNormKernel
<
DeviceType
,
T
>>
{
public:
BatchNormOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
BatchNormParam
,
BatchNormKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{
}
:
framework
::
OperatorWithKernel
<
DeviceType
,
BatchNormParam
,
BatchNormKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{
}
void
InferShape
()
const
override
;
...
...
src/operators/box_coder_op.h
浏览文件 @
e6302412
...
...
@@ -28,16 +28,21 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
BoxCoderOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>
{
class
BoxCoderOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>
{
public:
BoxCoderOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
BoxCoderParam
,
operators
::
BoxCoderKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/concat_op.h
浏览文件 @
e6302412
...
...
@@ -24,17 +24,22 @@ namespace paddle_mobile {
namespace
operators
{
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
ConcatOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>
{
class
ConcatOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>
{
public:
ConcatOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{
}
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{
}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConcatParam
,
operators
::
ConcatKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
};
...
...
src/operators/conv_op.h
浏览文件 @
e6302412
...
...
@@ -24,15 +24,20 @@ namespace paddle_mobile {
namespace
operators
{
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
ConvOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>
{
class
ConvOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>
{
public:
ConvOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
){}
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
ConvKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
private:
...
...
src/operators/depthwise_conv_op.h
浏览文件 @
e6302412
...
...
@@ -24,16 +24,22 @@ namespace paddle_mobile {
namespace
operators
{
template
<
typename
DeviceType
,
typename
T
>
class
DepthwiseConvOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>
{
class
DepthwiseConvOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>
{
public:
DepthwiseConvOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ConvParam
,
operators
::
DepthwiseConvKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
private:
...
...
src/operators/elementwise_add_op.h
浏览文件 @
e6302412
...
...
@@ -25,16 +25,22 @@ namespace paddle_mobile {
namespace
operators
{
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
ElementwiseAddOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>
{
class
ElementwiseAddOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>
{
public:
ElementwiseAddOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ElementwiseAddParam
,
operators
::
ElementwiseAddKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/fusion_conv_add.h
浏览文件 @
e6302412
...
...
@@ -47,16 +47,21 @@ class FusionConvAddMatcher : public framework::FusionOpMatcher {
};
template
<
typename
DeviceType
,
typename
T
>
class
FushionConvAddOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>
{
class
FushionConvAddOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>
{
public:
FushionConvAddOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
FushionConvAddParam
,
operators
::
ConvAddKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/fusion_fc_op.h
浏览文件 @
e6302412
...
...
@@ -45,16 +45,22 @@ class FusionFcMatcher : public framework::FusionOpMatcher {
};
template
<
typename
DeviceType
,
typename
T
>
class
FushionFcOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>
{
class
FushionFcOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>
{
public:
FushionFcOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
FushionFcParam
,
operators
::
FushionFcKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/kernel/arm/batchnorm_kernel.cpp
浏览文件 @
e6302412
...
...
@@ -61,7 +61,7 @@ void BatchNormKernel<CPU, float>::Compute(const BatchNormParam ¶m) const {
/// std = (var + epsilon).sqrt();
/// inv_std = 1 / std;
for
(
int
i
=
0
;
i
<
C
*
4
;
i
+=
4
)
{
int
index
=
i
/
4
;
int
index
=
i
/
4
;
inv_std_ptr
[
i
]
=
1
/
static_cast
<
float
>
(
pow
((
variance_ptr
[
index
]
+
epsilon
),
0.5
));
inv_std_ptr
[
i
+
1
]
=
inv_std_ptr
[
i
];
...
...
src/operators/kernel/mali/conv_kernel.cpp
浏览文件 @
e6302412
...
...
@@ -21,8 +21,8 @@ namespace operators {
template
<
>
void
ConvKernel
<
GPU_MALI
,
float
>::
Compute
(
const
ConvParam
&
param
)
const
{
// ArmConvImplement imp;
// imp.Compute(param);
// ArmConvImplement imp;
// imp.Compute(param);
}
template
class
ConvKernel
<
GPU_MALI
,
float
>;
...
...
src/operators/lrn_op.h
浏览文件 @
e6302412
...
...
@@ -25,16 +25,21 @@ namespace paddle_mobile {
namespace
operators
{
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
LrnOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>
{
class
LrnOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>
{
public:
LrnOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
LrnParam
,
operators
::
LrnKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
};
...
...
src/operators/mul_op.h
浏览文件 @
e6302412
...
...
@@ -25,15 +25,19 @@ namespace paddle_mobile {
namespace
operators
{
template
<
typename
DeviceType
,
typename
T
>
class
MulOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>
{
class
MulOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>
{
public:
MulOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
MulParam
,
operators
::
MulKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/multiclass_nms_op.h
浏览文件 @
e6302412
...
...
@@ -28,16 +28,22 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
MultiClassNMSOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>
{
class
MultiClassNMSOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>
{
public:
MultiClassNMSOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
MultiClassNMSParam
,
operators
::
MultiClassNMSKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/pool_op.h
浏览文件 @
e6302412
...
...
@@ -29,13 +29,18 @@ using framework::OperatorWithKernel;
using
framework
::
Scope
;
using
std
::
string
;
template
<
typename
DeviceType
,
typename
T
>
class
PoolOp
:
public
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>
{
class
PoolOp
:
public
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>
{
public:
PoolOp
(
const
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
std
::
shared_ptr
<
Scope
>
scope
)
:
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
OperatorWithKernel
<
DeviceType
,
PoolParam
,
operators
::
PoolKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
private:
...
...
src/operators/prior_box_op.h
浏览文件 @
e6302412
...
...
@@ -28,16 +28,21 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
PriorBoxOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>
{
class
PriorBoxOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>
{
public:
PriorBoxOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
PriorBoxParam
,
operators
::
PriorBoxKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/relu_op.h
浏览文件 @
e6302412
...
...
@@ -28,7 +28,9 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
ReluOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>
{
class
ReluOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>
{
public:
/*
* @b op 的实例化方法, 需要调用父类的实例化方法, 以及实例化自己的参数结构体
...
...
@@ -36,10 +38,13 @@ class ReluOp : public framework::OperatorWithKernel<DeviceType, ReluParam, opera
ReluOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
ReluParam
,
operators
::
ReluKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/reshape_op.h
浏览文件 @
e6302412
...
...
@@ -28,16 +28,21 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
ReshapeOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>
{
class
ReshapeOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>
{
public:
ReshapeOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
ReshapeParam
,
operators
::
ReshapeKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
...
...
src/operators/sigmoid_op.h
浏览文件 @
e6302412
...
...
@@ -25,16 +25,21 @@ limitations under the License. */
namespace
paddle_mobile
{
namespace
operators
{
template
<
typename
DeviceType
,
typename
T
>
class
SigmoidOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>
{
class
SigmoidOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>
{
public:
SigmoidOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
SigmoidParam
,
operators
::
SigmoidKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
};
...
...
src/operators/softmax_op.h
浏览文件 @
e6302412
...
...
@@ -25,16 +25,21 @@ limitations under the License. */
namespace
paddle_mobile
{
namespace
operators
{
template
<
typename
DeviceType
,
typename
T
>
class
SoftmaxOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>
{
class
SoftmaxOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>
{
public:
SoftmaxOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
:
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
using
framework
::
OperatorWithKernel
<
DeviceType
,
SoftmaxParam
,
operators
::
SoftmaxKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
...
...
src/operators/transpose_op.h
浏览文件 @
e6302412
...
...
@@ -28,16 +28,22 @@ namespace operators {
using
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
TransposeOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>
{
class
TransposeOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>
{
public:
TransposeOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
:
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
using
framework
::
OperatorWithKernel
<
DeviceType
,
TransposeParam
,
operators
::
TransposeKernel
<
DeviceType
,
T
>>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录