Unverified Commit 912c44fa authored by David Garcia's avatar David Garcia Committed by GitHub
Browse files

Fix Resize() documentation (#7536)


Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
Co-authored-by: default avatarNicolas Hug <nh.nicolas.hug@gmail.com>
parent e946e87d
...@@ -423,13 +423,13 @@ def resize( ...@@ -423,13 +423,13 @@ def resize(
supported. supported.
The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well.
max_size (int, optional): The maximum allowed for the longer edge of max_size (int, optional): The maximum allowed for the longer edge of
the resized image: if the longer edge of the image is greater the resized image. If the longer edge of the image is greater
than ``max_size`` after being resized according to ``size``, then than ``max_size`` after being resized according to ``size``,
the image is resized again so that the longer edge is equal to ``size`` will be overruled so that the longer edge is equal to
``max_size``. As a result, ``size`` might be overruled, i.e. the ``max_size``.
smaller edge may be shorter than ``size``. This is only supported As a result, the smaller edge may be shorter than ``size``. This
if ``size`` is an int (or a sequence of length 1 in torchscript is only supported if ``size`` is an int (or a sequence of length
mode). 1 in torchscript mode).
antialias (bool, optional): Whether to apply antialiasing. antialias (bool, optional): Whether to apply antialiasing.
It only affects **tensors** with bilinear or bicubic modes and it is It only affects **tensors** with bilinear or bicubic modes and it is
ignored otherwise: on PIL images, antialiasing is always applied on ignored otherwise: on PIL images, antialiasing is always applied on
......
...@@ -307,13 +307,13 @@ class Resize(torch.nn.Module): ...@@ -307,13 +307,13 @@ class Resize(torch.nn.Module):
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported. ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well.
max_size (int, optional): The maximum allowed for the longer edge of max_size (int, optional): The maximum allowed for the longer edge of
the resized image: if the longer edge of the image is greater the resized image. If the longer edge of the image is greater
than ``max_size`` after being resized according to ``size``, then than ``max_size`` after being resized according to ``size``,
the image is resized again so that the longer edge is equal to ``size`` will be overruled so that the longer edge is equal to
``max_size``. As a result, ``size`` might be overruled, i.e. the ``max_size``.
smaller edge may be shorter than ``size``. This is only supported As a result, the smaller edge may be shorter than ``size``. This
if ``size`` is an int (or a sequence of length 1 in torchscript is only supported if ``size`` is an int (or a sequence of length
mode). 1 in torchscript mode).
antialias (bool, optional): Whether to apply antialiasing. antialias (bool, optional): Whether to apply antialiasing.
It only affects **tensors** with bilinear or bicubic modes and it is It only affects **tensors** with bilinear or bicubic modes and it is
ignored otherwise: on PIL images, antialiasing is always applied on ignored otherwise: on PIL images, antialiasing is always applied on
......
...@@ -97,13 +97,13 @@ class Resize(Transform): ...@@ -97,13 +97,13 @@ class Resize(Transform):
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported. ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well.
max_size (int, optional): The maximum allowed for the longer edge of max_size (int, optional): The maximum allowed for the longer edge of
the resized image: if the longer edge of the image is greater the resized image. If the longer edge of the image is greater
than ``max_size`` after being resized according to ``size``, then than ``max_size`` after being resized according to ``size``,
the image is resized again so that the longer edge is equal to ``size`` will be overruled so that the longer edge is equal to
``max_size``. As a result, ``size`` might be overruled, i.e. the ``max_size``.
smaller edge may be shorter than ``size``. This is only supported As a result, the smaller edge may be shorter than ``size``. This
if ``size`` is an int (or a sequence of length 1 in torchscript is only supported if ``size`` is an int (or a sequence of length
mode). 1 in torchscript mode).
antialias (bool, optional): Whether to apply antialiasing. antialias (bool, optional): Whether to apply antialiasing.
It only affects **tensors** with bilinear or bicubic modes and it is It only affects **tensors** with bilinear or bicubic modes and it is
ignored otherwise: on PIL images, antialiasing is always applied on ignored otherwise: on PIL images, antialiasing is always applied on
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment