Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a7ff1140
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a7ff1140
编写于
6月 27, 2017
作者:
H
hedaoyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change the ImageFunction name to BlockFunction(Consistent with the name of Layer).
上级
a83d5215
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
15 deletion
+15
-15
paddle/function/ImageExpandOp.cpp
paddle/function/ImageExpandOp.cpp
+9
-9
paddle/function/ImageExpandOpTest.cpp
paddle/function/ImageExpandOpTest.cpp
+4
-4
paddle/gserver/layers/BlockExpandLayer.cpp
paddle/gserver/layers/BlockExpandLayer.cpp
+2
-2
未找到文件。
paddle/function/ImageExpandOp.cpp
浏览文件 @
a7ff1140
...
...
@@ -32,7 +32,7 @@ namespace paddle {
* \param inputs[0] Sequence data of NST format.
* \param outputs[0] Image data of NCHW format.
*/
class
Image
ExpandFunction
:
public
FunctionBase
{
class
Block
ExpandFunction
:
public
FunctionBase
{
public:
void
init
(
const
FuncConfig
&
config
)
override
{
// function arguments
...
...
@@ -100,10 +100,10 @@ protected:
};
template
<
DeviceType
Device
>
class
ImageExpandForward
:
public
Image
ExpandFunction
{
class
BlockExpandForward
:
public
Block
ExpandFunction
{
public:
void
init
(
const
FuncConfig
&
config
)
override
{
Image
ExpandFunction
::
init
(
config
);
Block
ExpandFunction
::
init
(
config
);
}
void
check
(
const
BufferArgs
&
inputs
,
const
BufferArgs
&
outputs
)
override
{
...
...
@@ -148,10 +148,10 @@ public:
};
template
<
DeviceType
Device
>
class
ImageExpandBackward
:
public
Image
ExpandFunction
{
class
BlockExpandBackward
:
public
Block
ExpandFunction
{
public:
void
init
(
const
FuncConfig
&
config
)
override
{
Image
ExpandFunction
::
init
(
config
);
Block
ExpandFunction
::
init
(
config
);
}
void
check
(
const
BufferArgs
&
inputs
,
const
BufferArgs
&
outputs
)
override
{
...
...
@@ -192,11 +192,11 @@ public:
}
};
REGISTER_TYPED_FUNC
(
ImageExpand
,
CPU
,
Image
ExpandForward
);
REGISTER_TYPED_FUNC
(
ImageExpandGrad
,
CPU
,
Image
ExpandBackward
);
REGISTER_TYPED_FUNC
(
BlockExpand
,
CPU
,
Block
ExpandForward
);
REGISTER_TYPED_FUNC
(
BlockExpandGrad
,
CPU
,
Block
ExpandBackward
);
#ifndef PADDLE_ONLY_CPU
REGISTER_TYPED_FUNC
(
ImageExpand
,
GPU
,
Image
ExpandForward
);
REGISTER_TYPED_FUNC
(
ImageExpandGrad
,
GPU
,
Image
ExpandBackward
);
REGISTER_TYPED_FUNC
(
BlockExpand
,
GPU
,
Block
ExpandForward
);
REGISTER_TYPED_FUNC
(
BlockExpandGrad
,
GPU
,
Block
ExpandBackward
);
#endif
}
// namespace paddle
paddle/function/ImageExpandOpTest.cpp
浏览文件 @
a7ff1140
...
...
@@ -17,7 +17,7 @@ limitations under the License. */
namespace
paddle
{
TEST
(
Image
ExpandForward
,
real
)
{
TEST
(
Block
ExpandForward
,
real
)
{
for
(
size_t
batchSize
:
{
5
,
32
})
{
for
(
size_t
channels
:
{
1
,
5
,
32
})
{
for
(
size_t
inputHeight
:
{
5
,
33
,
100
})
{
...
...
@@ -29,7 +29,7 @@ TEST(ImageExpandForward, real) {
std
::
vector
<
size_t
>
strides
=
{
stride
,
stride
};
std
::
vector
<
size_t
>
paddings
=
{
padding
,
padding
};
std
::
vector
<
size_t
>
blocks
=
{
block
,
block
};
CpuGpuFuncCompare
test
(
"
Image
Expand"
,
CpuGpuFuncCompare
test
(
"
Block
Expand"
,
FuncConfig
()
.
set
(
"strides"
,
strides
)
.
set
(
"paddings"
,
paddings
)
...
...
@@ -60,7 +60,7 @@ TEST(ImageExpandForward, real) {
}
}
TEST
(
Image
ExpandBackward
,
real
)
{
TEST
(
Block
ExpandBackward
,
real
)
{
for
(
size_t
batchSize
:
{
5
,
32
})
{
for
(
size_t
channels
:
{
1
,
5
,
32
})
{
for
(
size_t
inputHeight
:
{
5
,
33
,
100
})
{
...
...
@@ -72,7 +72,7 @@ TEST(ImageExpandBackward, real) {
std
::
vector
<
size_t
>
strides
=
{
stride
,
stride
};
std
::
vector
<
size_t
>
paddings
=
{
padding
,
padding
};
std
::
vector
<
size_t
>
blocks
=
{
block
,
block
};
CpuGpuFuncCompare
test
(
"
Image
ExpandGrad"
,
CpuGpuFuncCompare
test
(
"
Block
ExpandGrad"
,
FuncConfig
()
.
set
(
"strides"
,
strides
)
.
set
(
"paddings"
,
paddings
)
...
...
paddle/gserver/layers/BlockExpandLayer.cpp
浏览文件 @
a7ff1140
...
...
@@ -41,13 +41,13 @@ bool BlockExpandLayer::init(const LayerMap& layerMap,
std
::
vector
<
size_t
>
paddings
=
{(
size_t
)
paddingH_
,
(
size_t
)
paddingW_
};
std
::
vector
<
size_t
>
blocks
=
{(
size_t
)
blockH_
,
(
size_t
)
blockW_
};
createFunction
(
forward_
,
"
Image
Expand"
,
"
Block
Expand"
,
FuncConfig
()
.
set
(
"strides"
,
strides
)
.
set
(
"paddings"
,
paddings
)
.
set
(
"blocks"
,
blocks
));
createFunction
(
backward_
,
"
Image
ExpandGrad"
,
"
Block
ExpandGrad"
,
FuncConfig
()
.
set
(
"strides"
,
strides
)
.
set
(
"paddings"
,
paddings
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录