Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a9490a10
P
Paddle
项目概览
机器未来
/
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看板
提交
a9490a10
编写于
11月 20, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make output channels changeable in reshape function
上级
d2e30a2c
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
19 addition
and
22 deletion
+19
-22
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNAddtoLayer.h
paddle/gserver/layers/MKLDNNAddtoLayer.h
+1
-1
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNBatchNormLayer.h
paddle/gserver/layers/MKLDNNBatchNormLayer.h
+1
-1
paddle/gserver/layers/MKLDNNConcatLayer.cpp
paddle/gserver/layers/MKLDNNConcatLayer.cpp
+4
-6
paddle/gserver/layers/MKLDNNConcatLayer.h
paddle/gserver/layers/MKLDNNConcatLayer.h
+1
-1
paddle/gserver/layers/MKLDNNConvLayer.cpp
paddle/gserver/layers/MKLDNNConvLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNConvLayer.h
paddle/gserver/layers/MKLDNNConvLayer.h
+1
-1
paddle/gserver/layers/MKLDNNFcLayer.cpp
paddle/gserver/layers/MKLDNNFcLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNFcLayer.h
paddle/gserver/layers/MKLDNNFcLayer.h
+1
-1
paddle/gserver/layers/MKLDNNLayer.cpp
paddle/gserver/layers/MKLDNNLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNLayer.h
paddle/gserver/layers/MKLDNNLayer.h
+3
-4
paddle/gserver/layers/MKLDNNPoolLayer.cpp
paddle/gserver/layers/MKLDNNPoolLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNPoolLayer.h
paddle/gserver/layers/MKLDNNPoolLayer.h
+1
-1
未找到文件。
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -38,7 +38,7 @@ bool MKLDNNAddtoLayer::init(const LayerMap& layerMap,
}
void
MKLDNNAddtoLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
CHECK_EQ
(
layerSize_
,
getSize
())
<<
"this layer size can not be changed"
;
reshapeInput
(
bs
,
ih
,
iw
);
ic
=
inputLayers_
[
0
]
->
getSize
()
/
ih
/
iw
;
...
...
paddle/gserver/layers/MKLDNNAddtoLayer.h
浏览文件 @
a9490a10
...
...
@@ -50,7 +50,7 @@ public:
const
ParameterMap
&
parameterMap
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -116,7 +116,7 @@ void MKLDNNBatchNormLayer::calMovingMeanAndVar() {
}
void
MKLDNNBatchNormLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
reshapeInput
(
bs
,
ih
,
iw
);
oh
=
ih
;
ow
=
iw
;
...
...
paddle/gserver/layers/MKLDNNBatchNormLayer.h
浏览文件 @
a9490a10
...
...
@@ -73,7 +73,7 @@ public:
void
forward
(
PassType
passType
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNConcatLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -32,7 +32,7 @@ bool MKLDNNConcatLayer::init(const LayerMap& layerMap,
}
void
MKLDNNConcatLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
reshapeInput
(
bs
,
ih
,
iw
);
ic
=
inputLayers_
[
0
]
->
getSize
()
/
ih
/
iw
;
CHECK_EQ
((
size_t
)
ic
*
ih
*
iw
,
inputLayers_
[
0
]
->
getSize
());
...
...
@@ -40,9 +40,7 @@ void MKLDNNConcatLayer::reshape(
CHECK_GT
(
inputLayers_
.
size
(),
1UL
);
channels_
.
resize
(
inputLayers_
.
size
());
channels_
[
0
]
=
ic
;
// need change the output channel, so use oc_ instead
// TODO(TJ): change API, use &oc
oc_
=
ic
;
oc
=
ic
;
for
(
size_t
i
=
1
;
i
<
inputLayers_
.
size
();
i
++
)
{
int
batchsize
,
height
,
witdh
;
reshapeInput
(
batchsize
,
height
,
witdh
,
i
);
...
...
@@ -52,12 +50,12 @@ void MKLDNNConcatLayer::reshape(
channels_
[
i
]
=
inputLayers_
[
i
]
->
getSize
()
/
height
/
witdh
;
CHECK_EQ
((
size_t
)
channels_
[
i
]
*
height
*
witdh
,
inputLayers_
[
i
]
->
getSize
());
oc
_
+=
channels_
[
i
];
oc
+=
channels_
[
i
];
}
oh
=
ih
;
ow
=
iw
;
reshapeOutput
(
oh
,
ow
);
resizeOutput
(
bs
,
oc
_
*
oh
*
ow
);
resizeOutput
(
bs
,
oc
*
oh
*
ow
);
}
void
MKLDNNConcatLayer
::
resetFwd
(
std
::
vector
<
primitive
>&
pipeline
,
...
...
paddle/gserver/layers/MKLDNNConcatLayer.h
浏览文件 @
a9490a10
...
...
@@ -47,7 +47,7 @@ public:
const
ParameterMap
&
parameterMap
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNConvLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -90,7 +90,7 @@ void MKLDNNConvLayer::convertWeightsToPaddle() {
}
void
MKLDNNConvLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
reshapeInput
(
bs
,
ih
,
iw
);
// cal output sizes
...
...
paddle/gserver/layers/MKLDNNConvLayer.h
浏览文件 @
a9490a10
...
...
@@ -69,7 +69,7 @@ public:
const
ParameterMap
&
parameterMap
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNFcLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -74,7 +74,7 @@ void MKLDNNFcLayer::convertWeightsToPaddle() {
}
void
MKLDNNFcLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
reshapeInput
(
bs
,
ih
,
iw
);
CHECK_EQ
(
iLayerSize_
,
inputLayers_
[
0
]
->
getSize
());
...
...
paddle/gserver/layers/MKLDNNFcLayer.h
浏览文件 @
a9490a10
...
...
@@ -52,7 +52,7 @@ public:
const
ParameterMap
&
parameterMap
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -55,6 +55,7 @@ void MKLDNNLayer::forward(PassType passType) {
inputElemenCnt_
=
elemenCnt
;
pipelineFwd_
.
clear
();
reshape
(
bs_
,
ic_
,
ih_
,
iw_
,
oc_
,
oh_
,
ow_
);
printSizeInfo
();
// all cpu device output grad or value share output's
shareCPUDevice
();
resetFwd
(
pipelineFwd_
,
inVal_
,
wgtVal_
,
biasVal_
,
outVal_
);
...
...
@@ -72,7 +73,6 @@ void MKLDNNLayer::forward(PassType passType) {
pipelineFwd_
.
push_back
(
*
cvtOutVal_
);
}
convertWeightsFromPaddle
();
printSizeInfo
();
printValueFormat
();
needResetBwd_
=
true
;
}
...
...
paddle/gserver/layers/MKLDNNLayer.h
浏览文件 @
a9490a10
...
...
@@ -125,12 +125,11 @@ public:
virtual
void
backward
(
const
UpdateCallback
&
callback
);
/**
* reshape the input image sizes
* and reset output image and buffer size
* output channel can not be changed
* reshape the input and output channels and image sizes
* and reset output buffer size
*/
virtual
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
=
0
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
=
0
;
/**
* reset the mkldnn forward primitve and memories
...
...
paddle/gserver/layers/MKLDNNPoolLayer.cpp
浏览文件 @
a9490a10
...
...
@@ -58,7 +58,7 @@ bool MKLDNNPoolLayer::init(const LayerMap& layerMap,
}
void
MKLDNNPoolLayer
::
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
{
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
{
reshapeInput
(
bs
,
ih
,
iw
);
// ic_ and oc can not be changed
CHECK_EQ
(
inputElemenCnt_
/
bs
/
ih
/
iw
,
(
size_t
)
ic
)
...
...
paddle/gserver/layers/MKLDNNPoolLayer.h
浏览文件 @
a9490a10
...
...
@@ -53,7 +53,7 @@ public:
const
ParameterMap
&
parameterMap
)
override
;
void
reshape
(
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
oc
,
int
&
oh
,
int
&
ow
)
override
;
int
&
bs
,
int
&
ic
,
int
&
ih
,
int
&
iw
,
int
&
oc
,
int
&
oh
,
int
&
ow
)
override
;
void
resetFwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录