未验证 提交 f17b05d4 编写于 作者: K Kaipeng Deng 提交者: GitHub

Merge pull request #14492 from heavengate/resize_nearest_example

Add python example for resize_nearest Api
...@@ -5788,7 +5788,7 @@ def image_resize(input, ...@@ -5788,7 +5788,7 @@ def image_resize(input,
Examples: Examples:
.. code-block:: python .. code-block:: python
out = fluid.layers.image_resize(input, out_shape=[12, 12]) out = fluid.layers.image_resize(input, out_shape=[12, 12], resample="NEAREST")
""" """
resample_methods = { resample_methods = {
'BILINEAR': 'bilinear', 'BILINEAR': 'bilinear',
...@@ -5891,6 +5891,11 @@ def resize_bilinear(input, ...@@ -5891,6 +5891,11 @@ def resize_bilinear(input,
Returns: Returns:
${out_comment}. ${out_comment}.
Examples:
.. code-block:: python
out = fluid.layers.resize_bilinear(input, out_shape=[12, 12])
""" """
return image_resize(input, out_shape, scale, name, 'BILINEAR', actual_shape) return image_resize(input, out_shape, scale, name, 'BILINEAR', actual_shape)
...@@ -5937,6 +5942,11 @@ def resize_nearest(input, ...@@ -5937,6 +5942,11 @@ def resize_nearest(input,
Returns: Returns:
${out_comment}. ${out_comment}.
Examples:
.. code-block:: python
out = fluid.layers.resize_nearest(input, out_shape=[12, 12])
""" """
return image_resize(input, out_shape, scale, name, 'NEAREST', actual_shape) return image_resize(input, out_shape, scale, name, 'NEAREST', actual_shape)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册