Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a8eeef86
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8eeef86
编写于
11月 20, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make MKLDNNLayer input grad as a vector
上级
bc0d2557
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
77 addition
and
94 deletion
+77
-94
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
+6
-7
paddle/gserver/layers/MKLDNNAddtoLayer.h
paddle/gserver/layers/MKLDNNAddtoLayer.h
+1
-15
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
+4
-4
paddle/gserver/layers/MKLDNNBatchNormLayer.h
paddle/gserver/layers/MKLDNNBatchNormLayer.h
+1
-1
paddle/gserver/layers/MKLDNNConcatLayer.cpp
paddle/gserver/layers/MKLDNNConcatLayer.cpp
+3
-4
paddle/gserver/layers/MKLDNNConcatLayer.h
paddle/gserver/layers/MKLDNNConcatLayer.h
+1
-15
paddle/gserver/layers/MKLDNNConvLayer.cpp
paddle/gserver/layers/MKLDNNConvLayer.cpp
+4
-3
paddle/gserver/layers/MKLDNNConvLayer.h
paddle/gserver/layers/MKLDNNConvLayer.h
+1
-1
paddle/gserver/layers/MKLDNNFcLayer.cpp
paddle/gserver/layers/MKLDNNFcLayer.cpp
+5
-4
paddle/gserver/layers/MKLDNNFcLayer.h
paddle/gserver/layers/MKLDNNFcLayer.h
+1
-1
paddle/gserver/layers/MKLDNNLayer.cpp
paddle/gserver/layers/MKLDNNLayer.cpp
+13
-21
paddle/gserver/layers/MKLDNNLayer.h
paddle/gserver/layers/MKLDNNLayer.h
+32
-13
paddle/gserver/layers/MKLDNNPoolLayer.cpp
paddle/gserver/layers/MKLDNNPoolLayer.cpp
+4
-4
paddle/gserver/layers/MKLDNNPoolLayer.h
paddle/gserver/layers/MKLDNNPoolLayer.h
+1
-1
未找到文件。
paddle/gserver/layers/MKLDNNAddtoLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -69,16 +69,15 @@ void MKLDNNAddtoLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNAddtoLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
resetBwdBuffers
(
inGrads_
,
biasGrad_
,
out
);
in
=
inGrads_
[
0
];
resetBwdBuffers
(
inputs
,
biasGrad_
,
out
);
// backward only need share output grad to input grad
for
(
size_t
i
=
0
;
i
<
in
Grads_
.
size
();
i
++
)
{
if
(
in
Grads_
[
i
]
!=
nullptr
)
{
in
Grads_
[
i
]
=
out
;
inputLayers_
[
i
]
->
getOutputGrad
()
->
setData
(
in
Grads_
[
i
]
->
getData
());
for
(
size_t
i
=
0
;
i
<
in
puts
.
size
();
i
++
)
{
if
(
in
puts
[
i
]
!=
nullptr
)
{
in
puts
[
i
]
=
out
;
inputLayers_
[
i
]
->
getOutputGrad
()
->
setData
(
in
puts
[
i
]
->
getData
());
}
}
...
...
paddle/gserver/layers/MKLDNNAddtoLayer.h
浏览文件 @
a8eeef86
...
...
@@ -26,8 +26,6 @@ namespace paddle {
*/
class
MKLDNNAddtoLayer
:
public
MKLDNNLayer
{
protected:
std
::
vector
<
MKLDNNMatrixPtr
>
inGrads_
;
// layer size == ic * ih * iw == oc * oh *ow, and can not be changed
size_t
layerSize_
;
...
...
@@ -56,23 +54,11 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
updateWeights
(
const
UpdateCallback
&
callback
)
override
;
void
printGradFormat
()
override
{
if
(
extOutGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
extOutGrad_
->
getFormat
();
}
if
(
outGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
outGrad_
->
getFormat
()
<<
" <<< "
;
}
for
(
size_t
i
=
0
;
i
<
inGrads_
.
size
();
++
i
)
{
VLOG
(
MKLDNN_FMTS
)
<<
i
<<
" input: "
<<
inGrads_
[
i
]
->
getFormat
()
<<
"<<<"
;
}
}
protected:
void
resetFwdBuffers
(
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
bias
,
...
...
paddle/gserver/layers/MKLDNNBatchNormLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -146,15 +146,15 @@ void MKLDNNBatchNormLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNBatchNormLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
std
::
shared_ptr
<
bn_bwd
::
primitive_desc
>
pd
;
resetBwdBuffers
(
in
,
wgtGrad_
,
out
);
resetBwdBuffers
(
in
puts
[
0
]
,
wgtGrad_
,
out
);
resetBwdPD
(
pd
,
in
,
wgtGrad_
,
out
);
resetBwdPD
(
pd
,
in
puts
[
0
]
,
wgtGrad_
,
out
);
resetBwdPipeline
(
pipeline
,
pd
,
in
,
wgtGrad_
,
out
);
resetBwdPipeline
(
pipeline
,
pd
,
in
puts
[
0
]
,
wgtGrad_
,
out
);
}
void
MKLDNNBatchNormLayer
::
forward
(
PassType
passType
)
{
...
...
paddle/gserver/layers/MKLDNNBatchNormLayer.h
浏览文件 @
a8eeef86
...
...
@@ -80,7 +80,7 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
updateWeights
(
const
UpdateCallback
&
callback
)
override
;
...
...
paddle/gserver/layers/MKLDNNConcatLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -70,12 +70,11 @@ void MKLDNNConcatLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNConcatLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
resetBwdBuffers
(
inGrads_
,
out
);
in
=
inGrads_
[
0
];
resetBwdBuffers
(
inputs
,
out
);
resetBwdPipeline
(
pipeline
,
bwds_
,
in
Grads_
,
out
);
resetBwdPipeline
(
pipeline
,
bwds_
,
in
puts
,
out
);
}
void
MKLDNNConcatLayer
::
resetFwdBuffers
(
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
...
...
paddle/gserver/layers/MKLDNNConcatLayer.h
浏览文件 @
a8eeef86
...
...
@@ -26,7 +26,6 @@ namespace paddle {
*/
class
MKLDNNConcatLayer
:
public
MKLDNNLayer
{
protected:
std
::
vector
<
MKLDNNMatrixPtr
>
inGrads_
;
std
::
vector
<
std
::
shared_ptr
<
mkldnn
::
primitive
>>
bwds_
;
// input channel numbers
std
::
vector
<
int
>
channels_
;
...
...
@@ -53,7 +52,7 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
printSizeInfo
()
override
{
...
...
@@ -67,19 +66,6 @@ public:
<<
", "
<<
ow_
;
}
void
printGradFormat
()
override
{
if
(
extOutGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
extOutGrad_
->
getFormat
();
}
if
(
outGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
outGrad_
->
getFormat
()
<<
" <<< "
;
}
for
(
size_t
i
=
0
;
i
<
inGrads_
.
size
();
++
i
)
{
VLOG
(
MKLDNN_FMTS
)
<<
"Input "
<<
i
<<
", "
<<
inputLayers_
[
i
]
->
getName
()
<<
": "
<<
inGrads_
[
i
]
->
getFormat
()
<<
"<<<"
;
}
}
protected:
void
resetFwdBuffers
(
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
);
...
...
paddle/gserver/layers/MKLDNNConvLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -115,7 +115,7 @@ void MKLDNNConvLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNConvLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
std
::
shared_ptr
<
conv_bwdWgt
::
primitive_desc
>
bwdWgtPD
;
std
::
shared_ptr
<
conv_bwdData
::
primitive_desc
>
bwdDataPD
;
...
...
@@ -124,9 +124,10 @@ void MKLDNNConvLayer::resetBwd(std::vector<primitive>& pipeline,
resetBwdDataPD
(
bwdDataPD
);
resetBwdBuffers
(
bwdWgtPD
,
bwdDataPD
,
in
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdBuffers
(
bwdWgtPD
,
bwdDataPD
,
in
puts
[
0
]
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdPipeline
(
pipeline
,
bwdWgtPD
,
bwdDataPD
,
in
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdPipeline
(
pipeline
,
bwdWgtPD
,
bwdDataPD
,
inputs
[
0
],
wgtGrad_
,
biasGrad_
,
out
);
}
void
MKLDNNConvLayer
::
updateWeights
(
const
UpdateCallback
&
callback
)
{
...
...
paddle/gserver/layers/MKLDNNConvLayer.h
浏览文件 @
a8eeef86
...
...
@@ -76,7 +76,7 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
updateWeights
(
const
UpdateCallback
&
callback
)
override
;
...
...
paddle/gserver/layers/MKLDNNFcLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -97,18 +97,19 @@ void MKLDNNFcLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNFcLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
std
::
shared_ptr
<
fc_bwdWgt
::
primitive_desc
>
bwdWgtPD
;
std
::
shared_ptr
<
fc_bwdData
::
primitive_desc
>
bwdDataPD
;
resetBwdBuffers
(
in
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdBuffers
(
in
puts
[
0
]
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdWgtPD
(
bwdWgtPD
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdDataPD
(
bwdDataPD
,
in
,
out
);
resetBwdDataPD
(
bwdDataPD
,
in
puts
[
0
]
,
out
);
resetBwdPipeline
(
pipeline
,
bwdWgtPD
,
bwdDataPD
,
in
,
wgtGrad_
,
biasGrad_
,
out
);
resetBwdPipeline
(
pipeline
,
bwdWgtPD
,
bwdDataPD
,
inputs
[
0
],
wgtGrad_
,
biasGrad_
,
out
);
}
void
MKLDNNFcLayer
::
updateWeights
(
const
UpdateCallback
&
callback
)
{
...
...
paddle/gserver/layers/MKLDNNFcLayer.h
浏览文件 @
a8eeef86
...
...
@@ -59,7 +59,7 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
updateWeights
(
const
UpdateCallback
&
callback
)
override
;
...
...
paddle/gserver/layers/MKLDNNLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -91,22 +91,13 @@ void MKLDNNLayer::backward(const UpdateCallback& callback) {
if
(
needResetBwd_
)
{
VLOG
(
MKLDNN_BASE
)
<<
getName
()
<<
" reset mkldnn backward"
;
pipelineBwd_
.
clear
();
inGrads_
.
resize
(
inputLayers_
.
size
(),
nullptr
);
extInGrads_
.
resize
(
inputLayers_
.
size
(),
nullptr
);
cvtInGrads_
.
resize
(
inputLayers_
.
size
(),
nullptr
);
pipelineMergeGrad_
.
clear
();
mergeGrad_
=
nullptr
;
resetBwd
(
pipelineBwd_
,
inGrad_
,
outGrad_
);
// external output grad is not necessary
// since output may be mkldnn internal buffer or merge them directly.
CHECK
(
outGrad_
)
<<
"internal output grad is necessary"
;
if
(
extOutGrad_
)
{
CHECK_EQ
(
extOutGrad_
->
getData
(),
output_
.
grad
->
getData
())
<<
"the external buffer should share the same data with output_.grad"
;
}
if
(
cvtOutGrad_
)
{
pipelineBwd_
.
insert
(
pipelineBwd_
.
begin
(),
*
cvtOutGrad_
);
}
if
(
cvtInGrad_
)
{
pipelineBwd_
.
push_back
(
*
cvtInGrad_
);
}
resetBwd
(
pipelineBwd_
,
inGrads_
,
outGrad_
);
prepareGradConversions
(
pipelineBwd_
);
printGradFormat
();
needResetBwd_
=
false
;
}
...
...
@@ -214,8 +205,8 @@ void MKLDNNLayer::resetOutValue(MKLDNNMatrixPtr& out,
void
MKLDNNLayer
::
resetInGrad
(
MKLDNNMatrixPtr
&
in
,
memory
::
primitive_desc
intPD
,
size_t
idx
)
{
cvtInGrad
_
=
nullptr
;
extInGrad
_
=
nullptr
;
cvtInGrad
s_
[
idx
]
=
nullptr
;
extInGrad
s_
[
idx
]
=
nullptr
;
in
=
nullptr
;
LayerPtr
&
input
=
inputLayers_
[
idx
];
if
(
input
->
getOutputGrad
()
==
nullptr
)
{
...
...
@@ -237,19 +228,20 @@ void MKLDNNLayer::resetInGrad(MKLDNNMatrixPtr& in,
return
;
}
extInGrad
_
=
in
;
if
(
isPaddleFormat
(
extInGrad
_
->
getFormat
()))
{
extInGrad
s_
[
idx
]
=
in
;
if
(
isPaddleFormat
(
extInGrad
s_
[
idx
]
->
getFormat
()))
{
return
;
}
// need create reorder
CHECK
(
extInVals_
[
idx
]
!=
nullptr
&&
isPaddleFormat
(
extInVals_
[
idx
]
->
getFormat
()))
<<
"should have external input value and the format must be nchw(nc)"
;
extInGrad_
=
MKLDNNMatrix
::
create
(
extInVals_
[
idx
]
->
getPrimitiveDesc
(),
inMat
);
extInGrads_
[
idx
]
=
MKLDNNMatrix
::
create
(
extInVals_
[
idx
]
->
getPrimitiveDesc
(),
inMat
);
CHECK_PRIMITIVE_DESC_EQ
(
inVals_
[
idx
],
intPD
);
in
=
MKLDNNMatrix
::
create
(
intPD
);
cvtInGrad
_
=
MKLDNNMatrix
::
createReorder
(
in
,
extInGrad_
);
CHECK
(
cvtInGrad
_
);
cvtInGrad
s_
[
idx
]
=
MKLDNNMatrix
::
createReorder
(
in
,
extInGrads_
[
idx
]
);
CHECK
(
cvtInGrad
s_
[
idx
]
);
}
void
MKLDNNLayer
::
resetOutGrad
(
MKLDNNMatrixPtr
&
out
,
...
...
paddle/gserver/layers/MKLDNNLayer.h
浏览文件 @
a8eeef86
...
...
@@ -69,17 +69,17 @@ protected:
*/
// below MKLDNNMatrix buffers are all internal buffers
std
::
vector
<
MKLDNNMatrixPtr
>
inVals_
;
MKLDNNMatrixPtr
inGrad
_
;
std
::
vector
<
MKLDNNMatrixPtr
>
inGrads
_
;
MKLDNNMatrixPtr
outVal_
;
MKLDNNMatrixPtr
outGrad_
;
// below are external value and grad
std
::
vector
<
MKLDNNMatrixPtr
>
extInVals_
;
MKLDNNMatrixPtr
extInGrad
_
;
std
::
vector
<
MKLDNNMatrixPtr
>
extInGrads
_
;
MKLDNNMatrixPtr
extOutVal_
;
MKLDNNMatrixPtr
extOutGrad_
;
// convert handle between external and internal buffers
std
::
vector
<
std
::
shared_ptr
<
mkldnn
::
reorder
>>
cvtInVals_
;
std
::
shared_ptr
<
mkldnn
::
reorder
>
cvtInGrad
_
;
std
::
vector
<
std
::
shared_ptr
<
mkldnn
::
reorder
>>
cvtInGrads
_
;
std
::
shared_ptr
<
mkldnn
::
reorder
>
cvtOutVal_
;
std
::
shared_ptr
<
mkldnn
::
reorder
>
cvtOutGrad_
;
...
...
@@ -147,7 +147,7 @@ public:
* weight and bias buffers should be coverd by child class itself
*/
virtual
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
=
0
;
/**
...
...
@@ -319,17 +319,19 @@ protected:
* print the mkldnn memory format of grad
*/
virtual
void
printGradFormat
()
{
if
(
extOutGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
extOutGrad_
->
getFormat
();
}
if
(
outGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
outGrad_
->
getFormat
()
<<
" <<< "
;
VLOG
(
MKLDNN_FMTS
)
<<
outGrad_
->
getFormat
()
<<
" <<< "
<<
(
extOutGrad_
?
extOutGrad_
->
getFormat
()
:
outGrad_
->
getFormat
());
}
if
(
inGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
inGrad_
->
getFormat
()
<<
" <<<"
;
for
(
size_t
i
=
0
;
i
<
inGrads_
.
size
();
++
i
)
{
if
(
!
inGrads_
[
i
])
{
continue
;
}
if
(
extInGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
extInGrad_
->
getFormat
()
<<
" <<< "
;
VLOG
(
MKLDNN_FMTS
)
<<
"Input "
<<
i
<<
", "
<<
inputLayers_
[
i
]
->
getName
()
<<
": "
<<
(
extInGrads_
[
i
]
?
extInGrads_
[
i
]
->
getFormat
()
:
inGrads_
[
i
]
->
getFormat
())
<<
" <<< "
<<
inGrads_
[
i
]
->
getFormat
()
<<
" <<<"
;
}
if
(
wgtGrad_
)
{
VLOG
(
MKLDNN_FMTS
)
<<
"Weight grad format: "
<<
wgtGrad_
->
getFormat
();
...
...
@@ -454,6 +456,23 @@ private:
pipeline
.
push_back
(
*
cvtOutVal_
);
}
}
void
prepareGradConversions
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
)
{
// external output grad is not necessary
// since output may be mkldnn internal buffer or merge them directly.
CHECK
(
outGrad_
)
<<
"internal output grad is necessary"
;
if
(
extOutGrad_
)
{
CHECK_EQ
(
extOutGrad_
->
getData
(),
output_
.
grad
->
getData
())
<<
"the external buffer should share the same data with output_.grad"
;
}
if
(
cvtOutGrad_
)
{
pipeline
.
insert
(
pipeline
.
begin
(),
*
cvtOutGrad_
);
}
for
(
size_t
i
=
0
;
i
<
cvtInGrads_
.
size
();
++
i
)
{
if
(
cvtInGrads_
[
i
])
{
pipeline
.
push_back
(
*
cvtInGrads_
[
i
]);
}
}
}
};
}
// namespace paddle
paddle/gserver/layers/MKLDNNPoolLayer.cpp
浏览文件 @
a8eeef86
...
...
@@ -84,15 +84,15 @@ void MKLDNNPoolLayer::resetFwd(std::vector<primitive>& pipeline,
}
void
MKLDNNPoolLayer
::
resetBwd
(
std
::
vector
<
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
{
std
::
shared_ptr
<
pool_bwd
::
primitive_desc
>
pd
;
resetBwdBuffers
(
in
,
out
);
resetBwdBuffers
(
in
puts
[
0
]
,
out
);
resetBwdPD
(
pd
,
in
,
out
);
resetBwdPD
(
pd
,
in
puts
[
0
]
,
out
);
resetBwdPipeline
(
pipeline
,
pd
,
in
,
out
);
resetBwdPipeline
(
pipeline
,
pd
,
in
puts
[
0
]
,
out
);
}
void
MKLDNNPoolLayer
::
resetFwdBuffers
(
MKLDNNMatrixPtr
&
in
,
...
...
paddle/gserver/layers/MKLDNNPoolLayer.h
浏览文件 @
a8eeef86
...
...
@@ -60,7 +60,7 @@ public:
MKLDNNMatrixPtr
&
out
)
override
;
void
resetBwd
(
std
::
vector
<
mkldnn
::
primitive
>&
pipeline
,
MKLDNNMatrixPtr
&
in
,
std
::
vector
<
MKLDNNMatrixPtr
>&
inputs
,
MKLDNNMatrixPtr
&
out
)
override
;
void
printSizeInfo
()
override
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录