Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OPTHREE
Paddle
提交
37268dbd
P
Paddle
项目概览
OPTHREE
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
37268dbd
编写于
9月 18, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update using exclusive padding for avg-pool
上级
cc28fb4b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
16 deletion
+3
-16
paddle/gserver/layers/MKLDNNPoolLayer.cpp
paddle/gserver/layers/MKLDNNPoolLayer.cpp
+2
-11
paddle/gserver/tests/test_MKLDNN.cpp
paddle/gserver/tests/test_MKLDNN.cpp
+1
-5
未找到文件。
paddle/gserver/layers/MKLDNNPoolLayer.cpp
浏览文件 @
37268dbd
...
...
@@ -49,11 +49,8 @@ bool MKLDNNPoolLayer::init(const LayerMap& layerMap,
if
(
type
==
"max-projection"
)
{
poolAlgo_
=
algorithm
::
pooling_max
;
}
else
if
(
type
==
"avg-projection"
)
{
// TODO(TJ): support choosing exclusive or inclusive when paddle support it
// only can make sure that paddle use exclude when ph==pw==0
// otherwise, paddle may used mixed or only include.
poolAlgo_
=
(
ph_
==
0
&&
pw_
==
0
)
?
algorithm
::
pooling_avg_exclude_padding
:
algorithm
::
pooling_avg_include_padding
;
// paddle only use exclude_padding
poolAlgo_
=
algorithm
::
pooling_avg_exclude_padding
;
}
else
{
LOG
(
FATAL
)
<<
"unknow pooling type!"
;
}
...
...
@@ -178,12 +175,6 @@ void MKLDNNPoolLayer::resetFwdPD(std::shared_ptr<pool_fwd::primitive_desc>& pd,
padR
,
padKind
);
pd
.
reset
(
new
pool_fwd
::
primitive_desc
(
fwdDesc
,
engine_
));
if
((
ph_
!=
0
||
pw_
!=
0
)
&&
(
padR
[
0
]
>
padL
[
0
]
||
padR
[
1
]
>
padL
[
1
]))
{
LOG
(
WARNING
)
<<
"With this layer "
<<
getName
()
<<
", mkldnn_pool use "
<<
"inclusive pooling, while paddle mix inclusice and exclusive."
<<
"So they may have different results for this layer."
;
}
// prepare workspace if necessary
workspace_
=
...
...
paddle/gserver/tests/test_MKLDNN.cpp
浏览文件 @
37268dbd
...
...
@@ -192,11 +192,6 @@ void testPoolLayer(const testPoolDesc& pm) {
}
TEST
(
MkldnnLayer
,
PoolLayer
)
{
// For max pooling, MKLDNN has the same result with Paddle.
// For avg pooling, MKLDNN use either inclusive or exclusive pooling, while
// Paddle mixes these two types. So, when encountering some
// test cases with padding>0, they may get different results.
// Then MKLDNN layer will give warnning for these cases.
/* bs, ch, ih, iw, oh, ow, fh, fw, ph, pw, sh, sw*/
testPoolLayer
({
2
,
1
,
4
,
4
,
2
,
2
,
3
,
3
,
0
,
0
,
2
,
2
});
testPoolLayer
({
10
,
8
,
16
,
16
,
8
,
8
,
2
,
2
,
0
,
0
,
2
,
2
});
...
...
@@ -205,6 +200,7 @@ TEST(MkldnnLayer, PoolLayer) {
testPoolLayer
({
8
,
16
,
14
,
14
,
7
,
7
,
3
,
3
,
0
,
0
,
2
,
2
});
testPoolLayer
({
4
,
16
,
7
,
7
,
1
,
1
,
7
,
7
,
0
,
0
,
1
,
1
});
testPoolLayer
({
4
,
2
,
5
,
5
,
3
,
3
,
5
,
5
,
1
,
1
,
1
,
1
});
testPoolLayer
({
2
,
8
,
56
,
56
,
29
,
29
,
3
,
3
,
1
,
1
,
2
,
2
});
}
// TODO(TJ): add branch test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录