提交 31d830de 编写于 作者: T Tink_Y 提交者: Cheerego

refine image_resize annotation (#15976)

* fix image_resize annotation

test=develop

* fix some typo

* Update nn.py

* Update interpolate_op.cc

test=develop
上级 6d5a04c1
...@@ -84,13 +84,13 @@ class InterpolateOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -84,13 +84,13 @@ class InterpolateOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault("bilinear"); .SetDefault("bilinear");
AddAttr<bool>( AddAttr<bool>(
"align_corners", "align_corners",
"an optinal bool. Defaults to True. " "an optional bool. Defaults to True. "
"If True, the centers of 4 corner pixels of the input and output " "If True, the centers of 4 corner pixels of the input and output "
"tensors are aligned, preserving the values at the corner pixels, " "tensors are aligned, preserving the values at the corner pixels, "
"if Flase, are not aligned") "If False, are not aligned")
.SetDefault(true); .SetDefault(true);
AddAttr<int>("align_mode", AddAttr<int>("align_mode",
"(int, default \'1\'), optional for bilinear interpolation" "(int, default \'1\'), optional for bilinear interpolation, "
"can be \'0\' for src_idx = scale*(dst_indx+0.5)-0.5 , " "can be \'0\' for src_idx = scale*(dst_indx+0.5)-0.5 , "
"can be \'1\' for src_idx = scale*dst_index .") "can be \'1\' for src_idx = scale*dst_index .")
.SetDefault(1); .SetDefault(1);
......
...@@ -6844,6 +6844,8 @@ def image_resize(input, ...@@ -6844,6 +6844,8 @@ def image_resize(input,
Example: Example:
.. code-block:: text
For scale: For scale:
if align_corners = True && out_size > 1 : if align_corners = True && out_size > 1 :
...@@ -6863,8 +6865,8 @@ def image_resize(input, ...@@ -6863,8 +6865,8 @@ def image_resize(input,
input : (N,C,H_in,W_in) input : (N,C,H_in,W_in)
output: (N,C,H_out,W_out) where: output: (N,C,H_out,W_out) where:
H_out = \left \lfloor {H_{in} * scale_{}factor}} \right \rfloor H_out = floor (H_{in} * scale_{factor})
W_out = \left \lfloor {W_{in} * scale_{}factor}} \right \rfloor W_out = floor (W_{in} * scale_{factor})
else: else:
align_corners = True align_corners = True
...@@ -7048,12 +7050,10 @@ def resize_bilinear(input, ...@@ -7048,12 +7050,10 @@ def resize_bilinear(input,
Align_corners and align_mode are optinal parameters,the calculation Align_corners and align_mode are optinal parameters,the calculation
method of interpolation can be selected by them. method of interpolation can be selected by them.
Align_corners and align_mode are optinal parameters,the calculation method
of interpolation can be selected by them.
Example: Example:
.. code-block:: text
For scale: For scale:
if align_corners = True && out_size > 1 : if align_corners = True && out_size > 1 :
...@@ -7134,12 +7134,14 @@ def resize_nearest(input, ...@@ -7134,12 +7134,14 @@ def resize_nearest(input,
align_corners=True): align_corners=True):
""" """
Resize input by performing nearest neighbor interpolation in both the Resize input by performing nearest neighbor interpolation in both the
3rd dimention(in height direction) and the 4th dimention(in width 3rd dimension(in height direction) and the 4th dimension(in width
direction) based on given output shape which specified by actual_shape, direction) based on given output shape which is specified by actual_shape,
out_shape and scale in priority order. out_shape and scale in priority order.
Example: Example:
.. code-block:: text
For scale: For scale:
if align_corners = True && out_size > 1 : if align_corners = True && out_size > 1 :
...@@ -7159,8 +7161,8 @@ def resize_nearest(input, ...@@ -7159,8 +7161,8 @@ def resize_nearest(input,
input : (N,C,H_in,W_in) input : (N,C,H_in,W_in)
output: (N,C,H_out,W_out) where: output: (N,C,H_out,W_out) where:
H_out = \left \lfloor {H_{in} * scale_{}factor}} \right \rfloor H_out = floor(H_{in} * scale_{factor})
W_out = \left \lfloor {W_{in} * scale_{}factor}} \right \rfloor W_out = floor(W_{in} * scale_{factor})
else: else:
align_corners = True align_corners = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册