Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
7eb4a391
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看板
未验证
提交
7eb4a391
编写于
7月 07, 2020
作者:
H
HappyAngel
提交者:
GitHub
7月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve pooling speed in gaze model. (#3881)
* improve pooling speed in gaze. test=develoop * fix format test=develop
上级
6d787479
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
542 addition
and
128 deletion
+542
-128
lite/backends/arm/math/pooling.cc
lite/backends/arm/math/pooling.cc
+435
-76
lite/backends/arm/math/pooling.h
lite/backends/arm/math/pooling.h
+49
-24
lite/kernels/arm/pool_compute.cc
lite/kernels/arm/pool_compute.cc
+58
-28
未找到文件。
lite/backends/arm/math/pooling.cc
浏览文件 @
7eb4a391
此差异已折叠。
点击以展开。
lite/backends/arm/math/pooling.h
浏览文件 @
7eb4a391
...
@@ -76,7 +76,7 @@ void pooling1x1s2p0_max(const float* din,
...
@@ -76,7 +76,7 @@ void pooling1x1s2p0_max(const float* din,
int
pad_bottom
,
int
pad_bottom
,
int
pad_right
);
int
pad_right
);
void
pooling2x2s2_max
(
const
float
*
din
,
void
pooling2x2s2
p0
_max
(
const
float
*
din
,
float
*
dout
,
float
*
dout
,
int
num
,
int
num
,
int
chout
,
int
chout
,
...
@@ -88,7 +88,32 @@ void pooling2x2s2_max(const float* din,
...
@@ -88,7 +88,32 @@ void pooling2x2s2_max(const float* din,
int
pad_bottom
,
int
pad_bottom
,
int
pad_right
);
int
pad_right
);
void
pooling2x2s2_avg
(
const
float
*
din
,
void
pooling2x2s2p0_avg
(
const
float
*
din
,
float
*
dout
,
int
num
,
int
chout
,
int
hout
,
int
wout
,
int
chin
,
int
hin
,
int
win
,
bool
exclusive
,
int
pad_bottom
,
int
pad_right
);
void
pooling2x2s2p1_max
(
const
float
*
din
,
float
*
dout
,
int
num
,
int
chout
,
int
hout
,
int
wout
,
int
chin
,
int
hin
,
int
win
,
int
pad_bottom
,
int
pad_right
);
void
pooling2x2s2p1_avg
(
const
float
*
din
,
float
*
dout
,
float
*
dout
,
int
num
,
int
num
,
int
chout
,
int
chout
,
...
...
lite/kernels/arm/pool_compute.cc
浏览文件 @
7eb4a391
...
@@ -58,6 +58,7 @@ void PoolCompute::Run() {
...
@@ -58,6 +58,7 @@ void PoolCompute::Run() {
bool
global_pooling
=
(
paddings
[
0
]
==
0
)
&&
(
ksize
[
0
]
==
in_dims
[
2
])
&&
bool
global_pooling
=
(
paddings
[
0
]
==
0
)
&&
(
ksize
[
0
]
==
in_dims
[
2
])
&&
(
ksize
[
1
]
==
in_dims
[
3
])
&&
kps_equal
&&
pads_equal
;
(
ksize
[
1
]
==
in_dims
[
3
])
&&
kps_equal
&&
pads_equal
;
global_pooling
=
param
.
global_pooling
||
global_pooling
;
global_pooling
=
param
.
global_pooling
||
global_pooling
;
if
(
global_pooling
)
{
if
(
global_pooling
)
{
for
(
size_t
i
=
0
;
i
<
ksize
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
ksize
.
size
();
++
i
)
{
paddings
[
2
*
i
]
=
0
;
paddings
[
2
*
i
]
=
0
;
...
@@ -107,7 +108,7 @@ void PoolCompute::Run() {
...
@@ -107,7 +108,7 @@ void PoolCompute::Run() {
}
else
if
(
ksize
[
0
]
==
2
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
0
&&
}
else
if
(
ksize
[
0
]
==
2
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
0
&&
kps_equal
)
{
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling2x2s2_max
(
din
,
lite
::
arm
::
math
::
pooling2x2s2
p0
_max
(
din
,
dout
,
dout
,
out_dims
[
0
],
out_dims
[
0
],
out_dims
[
1
],
out_dims
[
1
],
...
@@ -120,7 +121,7 @@ void PoolCompute::Run() {
...
@@ -120,7 +121,7 @@ void PoolCompute::Run() {
paddings
[
3
]);
paddings
[
3
]);
return
;
return
;
}
else
if
(
pooling_type
==
"avg"
)
{
}
else
if
(
pooling_type
==
"avg"
)
{
lite
::
arm
::
math
::
pooling2x2s2_avg
(
din
,
lite
::
arm
::
math
::
pooling2x2s2
p0
_avg
(
din
,
dout
,
dout
,
out_dims
[
0
],
out_dims
[
0
],
out_dims
[
1
],
out_dims
[
1
],
...
@@ -134,8 +135,38 @@ void PoolCompute::Run() {
...
@@ -134,8 +135,38 @@ void PoolCompute::Run() {
paddings
[
3
]);
paddings
[
3
]);
return
;
return
;
}
}
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
1
&&
paddings
[
0
]
==
1
&&
}
else
if
(
ksize
[
0
]
==
2
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
1
&&
kps_equal
)
{
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling2x2s2p1_max
(
din
,
dout
,
out_dims
[
0
],
out_dims
[
1
],
out_dims
[
2
],
out_dims
[
3
],
in_dims
[
1
],
in_dims
[
2
],
in_dims
[
3
],
paddings
[
1
],
paddings
[
3
]);
return
;
}
else
if
(
pooling_type
==
"avg"
)
{
lite
::
arm
::
math
::
pooling2x2s2p1_avg
(
din
,
dout
,
out_dims
[
0
],
out_dims
[
1
],
out_dims
[
2
],
out_dims
[
3
],
in_dims
[
1
],
in_dims
[
2
],
in_dims
[
3
],
exclusive
,
paddings
[
1
],
paddings
[
3
]);
return
;
}
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
1
&&
paddings
[
0
]
==
1
&&
pads_equal
&&
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling3x3s1p1_max
(
din
,
lite
::
arm
::
math
::
pooling3x3s1p1_max
(
din
,
dout
,
dout
,
...
@@ -165,7 +196,7 @@ void PoolCompute::Run() {
...
@@ -165,7 +196,7 @@ void PoolCompute::Run() {
return
;
return
;
}
}
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
1
&&
paddings
[
0
]
==
0
&&
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
1
&&
paddings
[
0
]
==
0
&&
kps_equal
)
{
pads_equal
&&
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling3x3s1p0_max
(
din
,
lite
::
arm
::
math
::
pooling3x3s1p0_max
(
din
,
dout
,
dout
,
...
@@ -195,7 +226,7 @@ void PoolCompute::Run() {
...
@@ -195,7 +226,7 @@ void PoolCompute::Run() {
return
;
return
;
}
}
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
0
&&
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
0
&&
kps_equal
)
{
pads_equal
&&
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling3x3s2p0_max
(
din
,
lite
::
arm
::
math
::
pooling3x3s2p0_max
(
din
,
dout
,
dout
,
...
@@ -225,7 +256,7 @@ void PoolCompute::Run() {
...
@@ -225,7 +256,7 @@ void PoolCompute::Run() {
return
;
return
;
}
}
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
1
&&
}
else
if
(
ksize
[
0
]
==
3
&&
strides
[
0
]
==
2
&&
paddings
[
0
]
==
1
&&
kps_equal
)
{
pads_equal
&&
kps_equal
)
{
if
(
pooling_type
==
"max"
)
{
if
(
pooling_type
==
"max"
)
{
lite
::
arm
::
math
::
pooling3x3s2p1_max
(
din
,
lite
::
arm
::
math
::
pooling3x3s2p1_max
(
din
,
dout
,
dout
,
...
@@ -276,7 +307,6 @@ void PoolCompute::Run() {
...
@@ -276,7 +307,6 @@ void PoolCompute::Run() {
use_quantizer
,
use_quantizer
,
pooling_type
);
pooling_type
);
}
}
}
// namespace arm
}
// namespace arm
}
// namespace kernels
}
// namespace kernels
}
// namespace lite
}
// namespace lite
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录