Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
0d29e659
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0d29e659
编写于
6月 08, 2018
作者:
Y
yuyang18
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add resize_bilinear
上级
439a2657
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
19 deletion
+30
-19
paddle/fluid/operators/bilinear_interp_op.cc
paddle/fluid/operators/bilinear_interp_op.cc
+5
-6
python/paddle/fluid/layers/layer_function_generator.py
python/paddle/fluid/layers/layer_function_generator.py
+10
-5
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+15
-8
未找到文件。
paddle/fluid/operators/bilinear_interp_op.cc
浏览文件 @
0d29e659
...
@@ -56,17 +56,16 @@ class BilinearInterpOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -56,17 +56,16 @@ class BilinearInterpOpMaker : public framework::OpProtoAndCheckerMaker {
public:
public:
void
Make
()
override
{
void
Make
()
override
{
AddInput
(
"X"
,
AddInput
(
"X"
,
"
(Tensor)
The input tensor of bilinear interpolation, "
"The input tensor of bilinear interpolation, "
"This is a 4-D tensor with shape of (N x C x h x w)"
);
"This is a 4-D tensor with shape of (N x C x h x w)"
);
AddInput
(
"OutSize"
,
AddInput
(
"OutSize"
,
"
(Tensor)
This is a 1-D tensor with two number. "
"This is a 1-D tensor with two number. "
"The first number is height and the second number is width."
)
"The first number is height and the second number is width."
)
.
AsDispensable
();
.
AsDispensable
();
AddOutput
(
"Out"
,
AddOutput
(
"Out"
,
"The dimension of output is (N x C x out_h x out_w)"
);
"(Tensor) The dimension of output is (N x C x out_h x out_w]"
);
AddAttr
<
int
>
(
"out_h"
,
"
(int)
output height of bilinear interpolation op."
);
AddAttr
<
int
>
(
"out_h"
,
"output height of bilinear interpolation op."
);
AddAttr
<
int
>
(
"out_w"
,
"
(int)
output width of bilinear interpolation op."
);
AddAttr
<
int
>
(
"out_w"
,
"output width of bilinear interpolation op."
);
AddComment
(
R"DOC(
AddComment
(
R"DOC(
Bilinear interpolation is an extension of linear interpolation for
Bilinear interpolation is an extension of linear interpolation for
interpolating functions of two variables (e.g. H-direction and
interpolating functions of two variables (e.g. H-direction and
...
...
python/paddle/fluid/layers/layer_function_generator.py
浏览文件 @
0d29e659
...
@@ -224,7 +224,7 @@ def autodoc(comment=""):
...
@@ -224,7 +224,7 @@ def autodoc(comment=""):
return
__impl__
return
__impl__
def
templatedoc
():
def
templatedoc
(
op_type
=
None
):
"""
"""
Decorator of layer function. It will use the docstring from the layer
Decorator of layer function. It will use the docstring from the layer
function as the template. The template arguments are:
function as the template. The template arguments are:
...
@@ -242,15 +242,20 @@ def templatedoc():
...
@@ -242,15 +242,20 @@ def templatedoc():
return
msg
.
rstrip
(
'.'
)
return
msg
.
rstrip
(
'.'
)
def
__impl__
(
func
):
def
__impl__
(
func
):
op_proto
=
OpProtoHolder
.
instance
().
get_op_proto
(
func
.
__name__
)
if
op_type
is
None
:
op_type_name
=
func
.
__name__
else
:
op_type_name
=
op_type
op_proto
=
OpProtoHolder
.
instance
().
get_op_proto
(
op_type_name
)
tmpl
=
string
.
Template
(
func
.
__doc__
)
tmpl
=
string
.
Template
(
func
.
__doc__
)
comment_lines
=
op_proto
.
comment
.
split
(
"
\n
"
)
comment_lines
=
op_proto
.
comment
.
split
(
"
\n
"
)
comment
=
""
comment
=
""
for
line
in
comment_lines
:
for
line
in
comment_lines
:
line
=
line
.
lstrip
()
line
=
line
.
strip
()
comment
+=
line
if
len
(
line
)
!=
0
:
comment
+=
"
\n
"
comment
+=
line
comment
+=
" "
args
=
{
"comment"
:
trim_ending_dot
(
comment
)}
args
=
{
"comment"
:
trim_ending_dot
(
comment
)}
for
each_input
in
op_proto
.
inputs
:
for
each_input
in
op_proto
.
inputs
:
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
0d29e659
...
@@ -4037,18 +4037,25 @@ def image_resize(input,
...
@@ -4037,18 +4037,25 @@ def image_resize(input,
return
out
return
out
@
templatedoc
(
op_type
=
"bilinear_interp"
)
def
resize_bilinear
(
input
,
out_shape
=
None
,
scale
=
None
,
name
=
None
):
def
resize_bilinear
(
input
,
out_shape
=
None
,
scale
=
None
,
name
=
None
):
"""
"""
This is an alias of layer 'image_resize' with bilinear interpolation.
${comment}
Args:
input(${x_type}): ${x_comment}.
out_shape(${out_size_type}): ${out_size_comment}.
The mathematical meaning of resize bilinear layer is
scale(float|None): The multiplier for the input height or width. At
Bilinear interpolation.
least one of out_shape or scale must be set. And out_shape has
Bilinear interpolation is an extension of linear interpolation for
a higher priority than scale. Default: None.
interpolating functions of two variables (e.g. H-direction and
W-direction in this layer) on a rectilinear 2D grid.
name(str|None): The output variable name.
Returns:
For details, please refer to Wikipedia:
${out_comment}.
https://en.wikipedia.org/wiki/Bilinear_interpolation
"""
"""
return
image_resize
(
input
,
out_shape
,
scale
,
name
,
'BILINEAR'
)
return
image_resize
(
input
,
out_shape
,
scale
,
name
,
'BILINEAR'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录