Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
3e8bfc7b
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看板
提交
3e8bfc7b
编写于
8月 18, 2020
作者:
C
chenjiaoAngel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 5x5s2_dw
上级
04ff99f6
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
6116 addition
and
878 deletion
+6116
-878
lite/backends/arm/math/CMakeLists.txt
lite/backends/arm/math/CMakeLists.txt
+1
-0
lite/backends/arm/math/conv5x5s2_depthwise_fp32.cc
lite/backends/arm/math/conv5x5s2_depthwise_fp32.cc
+5100
-863
lite/backends/arm/math/conv5x5s2_depthwise_fp32_c4.cc
lite/backends/arm/math/conv5x5s2_depthwise_fp32_c4.cc
+946
-0
lite/backends/arm/math/conv_depthwise.h
lite/backends/arm/math/conv_depthwise.h
+19
-0
lite/backends/arm/math/conv_impl.cc
lite/backends/arm/math/conv_impl.cc
+37
-14
lite/kernels/arm/conv_depthwise.cc
lite/kernels/arm/conv_depthwise.cc
+13
-1
未找到文件。
lite/backends/arm/math/CMakeLists.txt
浏览文件 @
3e8bfc7b
...
...
@@ -82,6 +82,7 @@ if (NOT HAS_ARM_MATH_LIB_DIR)
conv5x5s1_depthwise_fp32.cc
conv5x5s2_depthwise_int8.cc
conv5x5s2_depthwise_fp32.cc
conv5x5s2_depthwise_fp32_c4.cc
conv3x3_winograd_fp32_c4.cc
conv3x3_winograd_int8.cc
conv_winograd_3x3.cc
...
...
lite/backends/arm/math/conv5x5s2_depthwise_fp32.cc
浏览文件 @
3e8bfc7b
此差异已折叠。
点击以展开。
lite/backends/arm/math/conv5x5s2_depthwise_fp32_c4.cc
0 → 100644
浏览文件 @
3e8bfc7b
此差异已折叠。
点击以展开。
lite/backends/arm/math/conv_depthwise.h
浏览文件 @
3e8bfc7b
...
...
@@ -193,6 +193,25 @@ void conv_depthwise_5x5s2_fp32(const float* din,
const
operators
::
ActivationParam
act_param
,
ARMContext
*
ctx
);
void
conv_depthwise_5x5s2_fp32
(
float
*
dout
,
const
float
*
din
,
const
float
*
weights
,
const
float
*
bias
,
bool
flag_bias
,
bool
flag_relu
,
int
num
,
int
chin
,
int
hin
,
int
win
,
int
hout
,
int
wout
,
int
pad_top
,
int
pad_bottom
,
int
pad_left
,
int
pad_right
,
const
operators
::
ActivationParam
&
act_param
,
ARMContext
*
ctx
);
void
conv_depthwise_5x5s2p2_fp32
(
const
float
*
din
,
float
*
dout
,
int
num
,
...
...
lite/backends/arm/math/conv_impl.cc
浏览文件 @
3e8bfc7b
...
...
@@ -734,22 +734,45 @@ void conv_depthwise_5x5_fp32(const void* din,
int
stride
=
param
.
strides
[
1
];
bool
flag_relu
=
param
.
fuse_relu
;
bool
flag_bias
=
param
.
bias
!=
nullptr
;
bool
ch_four
=
ch_in
>
4
*
w_in
;
bool
pads_five
=
(
pad_h
<
5
)
||
(
pad_w
<
5
);
ctx
->
ExtendWorkspace
((
w_in
+
w_out
)
*
sizeof
(
float
));
if
(
stride
==
2
)
{
conv_depthwise_5x5s2_fp32
(
reinterpret_cast
<
const
float
*>
(
din
),
reinterpret_cast
<
float
*>
(
dout
),
num
,
ch_out
,
h_out
,
w_out
,
ch_in
,
h_in
,
w_in
,
reinterpret_cast
<
const
float
*>
(
weights
),
bias
,
param
,
act_param
,
ctx
);
if
(
ch_four
||
!
pads_five
||
h_in
<
5
||
w_in
<
10
)
{
conv_depthwise_5x5s2_fp32
(
reinterpret_cast
<
const
float
*>
(
din
),
reinterpret_cast
<
float
*>
(
dout
),
num
,
ch_out
,
h_out
,
w_out
,
ch_in
,
h_in
,
w_in
,
reinterpret_cast
<
const
float
*>
(
weights
),
bias
,
param
,
act_param
,
ctx
);
else
{
conv_depthwise_5x5s2_fp32
(
reinterpret_cast
<
float
*>
(
dout
),
reinterpret_cast
<
const
float
*>
(
din
),
reinterpret_cast
<
const
float
*>
(
weights
),
bias
,
flag_bias
,
flag_relu
,
num
,
ch_in
,
h_in
,
w_in
,
h_out
,
w_out
,
paddings
[
0
],
paddings
[
1
],
paddings
[
2
],
paddings
[
3
],
act_param
,
ctx
);
}
}
else
if
(
stride
==
1
)
{
conv_depthwise_5x5s1_fp32
(
reinterpret_cast
<
float
*>
(
dout
),
reinterpret_cast
<
const
float
*>
(
din
),
...
...
lite/kernels/arm/conv_depthwise.cc
浏览文件 @
3e8bfc7b
...
...
@@ -28,7 +28,11 @@ void DepthwiseConv<PRECISION(kFloat), PRECISION(kFloat)>::PrepareForRun() {
auto
&
ctx
=
this
->
ctx_
->
template
As
<
ARMContext
>();
auto
w_dims
=
param
.
filter
->
dims
();
auto
kw
=
w_dims
[
3
];
auto
channel
=
w_dims
[
0
];
auto
hin
=
param
.
x
->
dims
()[
2
];
auto
win
=
param
.
x
->
dims
()[
3
];
auto
paddings
=
*
param
.
paddings
;
bool
ch_four
=
channel
<=
4
*
win
;
// select dw conv kernel
if
(
kw
==
3
)
{
bool
pads_less
=
((
paddings
[
1
]
<
2
)
&&
(
paddings
[
3
]
<
2
));
...
...
@@ -54,7 +58,15 @@ void DepthwiseConv<PRECISION(kFloat), PRECISION(kFloat)>::PrepareForRun() {
#endif
}
else
if
(
kw
==
5
)
{
auto
strides
=
param
.
strides
;
if
((
strides
[
0
]
==
1
&&
strides
[
1
]
==
1
)
||
bool
pads_five
=
(
paddings
[
0
]
<
5
)
||
(
paddings
[
2
]
<
5
);
if
(
ch_four
&&
pads_five
&&
win
>=
2
*
kw
&&
hin
>=
kw
&&
(
strides
[
0
]
==
2
&&
strides
[
1
]
==
2
)
{
flag_trans_weights_
=
false
;
impl_
=
lite
::
arm
::
math
::
conv_depthwise_5x5_fp32
;
#ifdef LITE_WITH_PROFILE
kernel_func_name_
=
"conv_depthwise_5x5_fp32"
;
#endif
}
else
if
((
strides
[
0
]
==
1
&&
strides
[
1
]
==
1
)
||
(
strides
[
0
]
==
2
&&
strides
[
1
]
==
2
))
{
// trans weights
constexpr
int
cblock
=
4
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录