Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
fa029636
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fa029636
编写于
7月 19, 2017
作者:
W
wanghaoshuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete debug log
上级
e8ee07f3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
2 addition
and
8 deletion
+2
-8
paddle/gserver/layers/SwitchOrderLayer.cpp
paddle/gserver/layers/SwitchOrderLayer.cpp
+2
-8
未找到文件。
paddle/gserver/layers/SwitchOrderLayer.cpp
浏览文件 @
fa029636
...
@@ -33,11 +33,9 @@ bool SwitchOrderLayer::init(const LayerMap& layerMap,
...
@@ -33,11 +33,9 @@ bool SwitchOrderLayer::init(const LayerMap& layerMap,
auto
&
reshape_conf
=
config_
.
reshape_conf
();
auto
&
reshape_conf
=
config_
.
reshape_conf
();
for
(
size_t
i
=
0
;
i
<
reshape_conf
.
heightaxis_size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
reshape_conf
.
heightaxis_size
();
i
++
)
{
LOG
(
INFO
)
<<
"reshape height axis: "
<<
reshape_conf
.
heightaxis
(
i
);
heightAxis_
.
push_back
(
reshape_conf
.
heightaxis
(
i
));
heightAxis_
.
push_back
(
reshape_conf
.
heightaxis
(
i
));
}
}
for
(
size_t
i
=
0
;
i
<
reshape_conf
.
widthaxis_size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
reshape_conf
.
widthaxis_size
();
i
++
)
{
LOG
(
INFO
)
<<
"reshape width axis: "
<<
reshape_conf
.
widthaxis
(
i
);
widthAxis_
.
push_back
(
reshape_conf
.
widthaxis
(
i
));
widthAxis_
.
push_back
(
reshape_conf
.
widthaxis
(
i
));
}
}
createFunction
(
nchw2nhwc_
,
"NCHW2NHWC"
,
FuncConfig
());
createFunction
(
nchw2nhwc_
,
"NCHW2NHWC"
,
FuncConfig
());
...
@@ -60,8 +58,6 @@ void SwitchOrderLayer::setOutDims() {
...
@@ -60,8 +58,6 @@ void SwitchOrderLayer::setOutDims() {
reshapeWidth_
*=
outDims_
[
widthAxis_
[
i
]];
reshapeWidth_
*=
outDims_
[
widthAxis_
[
i
]];
}
}
output_
.
setFrameWidth
(
reshapeWidth_
);
output_
.
setFrameWidth
(
reshapeWidth_
);
LOG
(
INFO
)
<<
"outDims: "
<<
outDims_
[
0
]
<<
"; "
<<
outDims_
[
1
]
<<
";"
<<
outDims_
[
2
]
<<
";"
<<
outDims_
[
3
];
}
}
void
SwitchOrderLayer
::
setInDims
()
{
void
SwitchOrderLayer
::
setInDims
()
{
...
@@ -76,8 +72,6 @@ void SwitchOrderLayer::setInDims() {
...
@@ -76,8 +72,6 @@ void SwitchOrderLayer::setInDims() {
int
totalCount
=
input
->
getElementCnt
();
int
totalCount
=
input
->
getElementCnt
();
int
channels
=
totalCount
/
(
inDims_
[
0
]
*
inDims_
[
2
]
*
inDims_
[
3
]);
int
channels
=
totalCount
/
(
inDims_
[
0
]
*
inDims_
[
2
]
*
inDims_
[
3
]);
if
(
channels
!=
0
)
inDims_
.
setDim
(
1
,
channels
);
if
(
channels
!=
0
)
inDims_
.
setDim
(
1
,
channels
);
LOG
(
INFO
)
<<
"inDims: "
<<
inDims_
[
0
]
<<
"; "
<<
inDims_
[
1
]
<<
";"
<<
inDims_
[
2
]
<<
";"
<<
inDims_
[
3
];
}
}
void
SwitchOrderLayer
::
forward
(
PassType
passType
)
{
void
SwitchOrderLayer
::
forward
(
PassType
passType
)
{
...
@@ -95,12 +89,12 @@ void SwitchOrderLayer::forward(PassType passType) {
...
@@ -95,12 +89,12 @@ void SwitchOrderLayer::forward(PassType passType) {
inputs
.
addArg
(
*
getInputValue
(
0
),
inDims_
);
inputs
.
addArg
(
*
getInputValue
(
0
),
inDims_
);
outputs
.
addArg
(
*
getOutputValue
(),
outDims_
);
outputs
.
addArg
(
*
getOutputValue
(),
outDims_
);
nchw2nhwc_
[
0
]
->
calc
(
inputs
,
outputs
);
nchw2nhwc_
[
0
]
->
calc
(
inputs
,
outputs
);
//
forwardActivation();
forwardActivation
();
}
}
void
SwitchOrderLayer
::
backward
(
const
UpdateCallback
&
callback
)
{
void
SwitchOrderLayer
::
backward
(
const
UpdateCallback
&
callback
)
{
(
void
)
callback
;
(
void
)
callback
;
//
backwardActivation();
backwardActivation
();
// switch NHWC to NCHW
// switch NHWC to NCHW
BufferArgs
inputs
;
BufferArgs
inputs
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录