未验证 提交 c34812ac 编写于 作者: I Infinity_lee 提交者: GitHub

fix boardcasting superlink (#48434)

* fix boardcasting superlink

* Update bitwise_op.cc

* fix typo errors(from 48186)

* Update python/paddle/distribution/uniform.py
Co-authored-by: NLigoml <39876205+Ligoml@users.noreply.github.com>

* Update math.py

* Update math.py

* refix

* Update logic.py

* BaseTransform api doc; test=docs_preview

* Update python/paddle/vision/transforms/transforms.py

* for text block; test=docs_preview

* Update transforms.py
Co-authored-by: NLigoml <39876205+Ligoml@users.noreply.github.com>
上级 4a66e7cf
...@@ -48,7 +48,9 @@ It operates ``%s`` on Tensor ``X`` and ``Y`` . ...@@ -48,7 +48,9 @@ It operates ``%s`` on Tensor ``X`` and ``Y`` .
%s %s
.. note:: .. note::
``paddle.%s`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.%s`` supports broadcasting. If you want know more about broadcasting, please refer to please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor.
)DOC", )DOC",
comment.type, comment.type,
comment.equation, comment.equation,
......
...@@ -49,7 +49,12 @@ class Uniform(distribution.Distribution): ...@@ -49,7 +49,12 @@ class Uniform(distribution.Distribution):
* :math:`Z`: is the normalizing constant. * :math:`Z`: is the normalizing constant.
The parameters `low` and `high` must be shaped in a way that supports The parameters `low` and `high` must be shaped in a way that supports
:ref:`user_guide_broadcasting` (e.g., `high - low` is a valid operation). `Boardcasting` (e.g., `high - low` is a valid operation).
Note:
If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
low(int|float|list|tuple|numpy.ndarray|Tensor): The lower boundary of low(int|float|list|tuple|numpy.ndarray|Tensor): The lower boundary of
......
...@@ -2005,8 +2005,10 @@ def complex(real, imag, name=None): ...@@ -2005,8 +2005,10 @@ def complex(real, imag, name=None):
Returns: Returns:
Tensor: The output tensor. The data type is 'complex64' or 'complex128', with the same precision as ``real`` and ``imag``. Tensor: The output tensor. The data type is 'complex64' or 'complex128', with the same precision as ``real`` and ``imag``.
**Note**: Note:
``paddle.complex`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.complex`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Examples: Examples:
.. code-block:: python .. code-block:: python
......
...@@ -96,7 +96,9 @@ def logical_and(x, y, out=None, name=None): ...@@ -96,7 +96,9 @@ def logical_and(x, y, out=None, name=None):
out = x \&\& y out = x \&\& y
Note: Note:
``paddle.logical_and`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.logical_and`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64. x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
...@@ -136,7 +138,9 @@ def logical_or(x, y, out=None, name=None): ...@@ -136,7 +138,9 @@ def logical_or(x, y, out=None, name=None):
out = x || y out = x || y
Note: Note:
``paddle.logical_or`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.logical_or`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64. x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
...@@ -178,7 +182,9 @@ def logical_xor(x, y, out=None, name=None): ...@@ -178,7 +182,9 @@ def logical_xor(x, y, out=None, name=None):
out = (x || y) \&\& !(x \&\& y) out = (x || y) \&\& !(x \&\& y)
Note: Note:
``paddle.logical_xor`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.logical_xor`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64. x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
...@@ -221,6 +227,11 @@ def logical_not(x, out=None, name=None): ...@@ -221,6 +227,11 @@ def logical_not(x, out=None, name=None):
out = !x out = !x
Note:
``paddle.logical_not`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x(Tensor): Operand of logical_not operator. Must be a Tensor of type bool, int8, int16, in32, in64, float32, or float64. x(Tensor): Operand of logical_not operator. Must be a Tensor of type bool, int8, int16, in32, in64, float32, or float64.
out(Tensor): The ``Tensor`` that specifies the output of the operator, which can be any ``Tensor`` that has been created in the program. The default value is None, and a new ``Tensor` will be created to save the output. out(Tensor): The ``Tensor`` that specifies the output of the operator, which can be any ``Tensor`` that has been created in the program. The default value is None, and a new ``Tensor` will be created to save the output.
......
...@@ -420,7 +420,9 @@ def pow(x, y, name=None): ...@@ -420,7 +420,9 @@ def pow(x, y, name=None):
out = x^{y} out = x^{y}
Note: Note:
``paddle.pow`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.pow`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensors
Args: Args:
...@@ -679,7 +681,9 @@ def subtract(x, y, name=None): ...@@ -679,7 +681,9 @@ def subtract(x, y, name=None):
out = x - y out = x - y
Note: Note:
``paddle.subtract`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.subtract`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
...@@ -773,7 +777,9 @@ def divide(x, y, name=None): ...@@ -773,7 +777,9 @@ def divide(x, y, name=None):
out = x / y out = x / y
Note: Note:
``paddle.divide`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.divide`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
...@@ -817,7 +823,10 @@ def floor_divide(x, y, name=None): ...@@ -817,7 +823,10 @@ def floor_divide(x, y, name=None):
out = trunc(x / y) out = trunc(x / y)
Note: Note:
``paddle.floor_divide`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.floor_divide`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Also note that the name ``floor_divide`` can be misleading, as the quotinents are actually rounded toward zero, not toward negative infinite. Also note that the name ``floor_divide`` can be misleading, as the quotinents are actually rounded toward zero, not toward negative infinite.
Args: Args:
...@@ -859,7 +868,9 @@ def remainder(x, y, name=None): ...@@ -859,7 +868,9 @@ def remainder(x, y, name=None):
out = x \% y out = x \% y
Note: Note:
``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
...@@ -924,7 +935,9 @@ def multiply(x, y, name=None): ...@@ -924,7 +935,9 @@ def multiply(x, y, name=None):
out = x * y out = x * y
Note: Note:
``paddle.multiply`` supports broadcasting. If you would like to know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.multiply`` supports broadcasting. If you would like to know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, its data type should be one of float32, float64, int32, int64, bool. x (Tensor): the input tensor, its data type should be one of float32, float64, int32, int64, bool.
...@@ -980,7 +993,9 @@ def maximum(x, y, name=None): ...@@ -980,7 +993,9 @@ def maximum(x, y, name=None):
out = max(x, y) out = max(x, y)
Note: Note:
``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
...@@ -1046,7 +1061,9 @@ def minimum(x, y, name=None): ...@@ -1046,7 +1061,9 @@ def minimum(x, y, name=None):
out = min(x, y) out = min(x, y)
Note: Note:
``paddle.minimum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.minimum`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
...@@ -1114,7 +1131,9 @@ def fmax(x, y, name=None): ...@@ -1114,7 +1131,9 @@ def fmax(x, y, name=None):
out = fmax(x, y) out = fmax(x, y)
Note: Note:
``paddle.fmax`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.fmax`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
...@@ -1182,7 +1201,9 @@ def fmin(x, y, name=None): ...@@ -1182,7 +1201,9 @@ def fmin(x, y, name=None):
out = fmin(x, y) out = fmin(x, y)
Note: Note:
``paddle.fmin`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.fmin`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64. x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
...@@ -3962,7 +3983,12 @@ def any(x, axis=None, keepdim=False, name=None): ...@@ -3962,7 +3983,12 @@ def any(x, axis=None, keepdim=False, name=None):
def broadcast_shape(x_shape, y_shape): def broadcast_shape(x_shape, y_shape):
""" """
The function returns the shape of doing operation with broadcasting on tensors of x_shape and y_shape, please refer to :ref:`user_guide_broadcasting` for more details. The function returns the shape of doing operation with broadcasting on tensors of x_shape and y_shape.
Note:
If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x_shape (list[int]|tuple[int]): A shape of tensor. x_shape (list[int]|tuple[int]): A shape of tensor.
...@@ -4991,7 +5017,9 @@ def heaviside(x, y, name=None): ...@@ -4991,7 +5017,9 @@ def heaviside(x, y, name=None):
\right. \right.
Note: Note:
``paddle.heaviside`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. ``paddle.heaviside`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Args: Args:
x (Tensor): The input tensor of Heaviside step function, it's data type should be float16, float32, float64, int32 or int64. x (Tensor): The input tensor of Heaviside step function, it's data type should be float16, float32, float64, int32 or int64.
......
...@@ -23,8 +23,8 @@ _image_backend = 'pil' ...@@ -23,8 +23,8 @@ _image_backend = 'pil'
def set_image_backend(backend): def set_image_backend(backend):
""" """
Specifies the backend used to load images in class ``paddle.vision.datasets.ImageFolder`` Specifies the backend used to load images in class :ref:`api_paddle_datasets_ImageFolder`
and ``paddle.vision.datasets.DatasetFolder`` . Now support backends are pillow and opencv. and :ref:`api_paddle_datasets_DatasetFolder` . Now support backends are pillow and opencv.
If backend not set, will use 'pil' as default. If backend not set, will use 'pil' as default.
Args: Args:
...@@ -117,7 +117,7 @@ def image_load(path, backend=None): ...@@ -117,7 +117,7 @@ def image_load(path, backend=None):
path (str): Path of the image. path (str): Path of the image.
backend (str, optional): The image decoding backend type. Options are backend (str, optional): The image decoding backend type. Options are
`cv2`, `pil`, `None`. If backend is None, the global _imread_backend `cv2`, `pil`, `None`. If backend is None, the global _imread_backend
specified by ``paddle.vision.set_image_backend`` will be used. Default: None. specified by :ref:`api_paddle_vision_set_image_backend` will be used. Default: None.
Returns: Returns:
PIL.Image or np.array: Loaded image. PIL.Image or np.array: Loaded image.
......
...@@ -42,7 +42,18 @@ def _is_numpy_image(img): ...@@ -42,7 +42,18 @@ def _is_numpy_image(img):
def to_tensor(pic, data_format='CHW'): def to_tensor(pic, data_format='CHW'):
"""Converts a ``PIL.Image`` or ``numpy.ndarray`` to paddle.Tensor. """Converts a ``PIL.Image`` or ``numpy.ndarray`` to paddle.Tensor.
See ``ToTensor`` for more details. Converts a PIL.Image or numpy.ndarray (H x W x C) to a paddle.Tensor of shape (C x H x W).
If input is a grayscale image (H x W), it will be converted to an image of shape (H x W x 1).
And the shape of output tensor will be (1 x H x W).
If you want to keep the shape of output tensor as (H x W x C), you can set data_format = ``HWC`` .
Converts a PIL.Image or numpy.ndarray in the range [0, 255] to a paddle.Tensor in the
range [0.0, 1.0] if the PIL Image belongs to one of the modes (L, LA, P, I, F, RGB, YCbCr,
RGBA, CMYK, 1) or if the numpy.ndarray has dtype = np.uint8.
In the other cases, tensors are returned without scaling.
Args: Args:
pic (PIL.Image|np.ndarray): Image to be converted to tensor. pic (PIL.Image|np.ndarray): Image to be converted to tensor.
...@@ -764,7 +775,7 @@ def rotate( ...@@ -764,7 +775,7 @@ def rotate(
center (2-list|2-tuple, optional): Optional center of rotation. center (2-list|2-tuple, optional): Optional center of rotation.
Origin is the upper left corner. Origin is the upper left corner.
Default is the center of the image. Default is the center of the image.
fill (3-list|3-tuple or int): RGB pixel fill value for area outside the rotated image. fill (3-list|3-tuple or int, optional): RGB pixel fill value for area outside the rotated image.
If int, it is used for all channels respectively. Default value is 0. If int, it is used for all channels respectively. Default value is 0.
......
...@@ -136,6 +136,8 @@ class BaseTransform: ...@@ -136,6 +136,8 @@ class BaseTransform:
calling logic: calling logic:
.. code-block:: text
if keys is None: if keys is None:
_get_params -> _apply_image() _get_params -> _apply_image()
else: else:
...@@ -153,14 +155,11 @@ class BaseTransform: ...@@ -153,14 +155,11 @@ class BaseTransform:
Current available strings & data type are describe below: Current available strings & data type are describe below:
- "image": input image, with shape of (H, W, C) - "image": input image, with shape of (H, W, C)
- "coords": coordinates, with shape of (N, 2) - "coords": coordinates, with shape of (N, 2)
- "boxes": bounding boxes, with shape of (N, 4), "xyxy" format, - "boxes": bounding boxes, with shape of (N, 4), "xyxy" format,the 1st "xy" represents
top left point of a box,the 2nd "xy" represents right bottom point.
the 1st "xy" represents top left point of a box, - "mask": map used for segmentation, with shape of (H, W, 1)
the 2nd "xy" represents right bottom point.
- "mask": map used for segmentation, with shape of (H, W, 1)
You can also customize your data types only if you implement the corresponding You can also customize your data types only if you implement the corresponding
_apply_*() methods, otherwise ``NotImplementedError`` will be raised. _apply_*() methods, otherwise ``NotImplementedError`` will be raised.
...@@ -433,9 +432,9 @@ class RandomResizedCrop(BaseTransform): ...@@ -433,9 +432,9 @@ class RandomResizedCrop(BaseTransform):
Args: Args:
size (int|list|tuple): Target size of output image, with (height, width) shape. size (int|list|tuple): Target size of output image, with (height, width) shape.
scale (list|tuple): Scale range of the cropped image before resizing, relatively to the origin scale (list|tuple, optional): Scale range of the cropped image before resizing, relatively to the origin
image. Default: (0.08, 1.0) image. Default: (0.08, 1.0).
ratio (list|tuple): Range of aspect ratio of the origin aspect ratio cropped. Default: (0.75, 1.33) ratio (list|tuple, optional): Range of aspect ratio of the origin aspect ratio cropped. Default: (0.75, 1.33)
interpolation (int|str, optional): Interpolation method. Default: 'bilinear'. when use pil backend, interpolation (int|str, optional): Interpolation method. Default: 'bilinear'. when use pil backend,
support method are as following: support method are as following:
- "nearest": Image.NEAREST, - "nearest": Image.NEAREST,
...@@ -778,7 +777,7 @@ class BrightnessTransform(BaseTransform): ...@@ -778,7 +777,7 @@ class BrightnessTransform(BaseTransform):
Args: Args:
value (float): How much to adjust the brightness. Can be any value (float): How much to adjust the brightness. Can be any
non negative number. 0 gives the original image non negative number. 0 gives the original image.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
...@@ -821,7 +820,7 @@ class ContrastTransform(BaseTransform): ...@@ -821,7 +820,7 @@ class ContrastTransform(BaseTransform):
Args: Args:
value (float): How much to adjust the contrast. Can be any value (float): How much to adjust the contrast. Can be any
non negative number. 0 gives the original image non negative number. 0 gives the original image.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
...@@ -866,7 +865,7 @@ class SaturationTransform(BaseTransform): ...@@ -866,7 +865,7 @@ class SaturationTransform(BaseTransform):
Args: Args:
value (float): How much to adjust the saturation. Can be any value (float): How much to adjust the saturation. Can be any
non negative number. 0 gives the original image non negative number. 0 gives the original image.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
...@@ -909,7 +908,7 @@ class HueTransform(BaseTransform): ...@@ -909,7 +908,7 @@ class HueTransform(BaseTransform):
Args: Args:
value (float): How much to adjust the hue. Can be any number value (float): How much to adjust the hue. Can be any number
between 0 and 0.5, 0 gives the original image between 0 and 0.5, 0 gives the original image.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
...@@ -953,14 +952,14 @@ class ColorJitter(BaseTransform): ...@@ -953,14 +952,14 @@ class ColorJitter(BaseTransform):
"""Randomly change the brightness, contrast, saturation and hue of an image. """Randomly change the brightness, contrast, saturation and hue of an image.
Args: Args:
brightness (float): How much to jitter brightness. brightness (float, optional): How much to jitter brightness.
Chosen uniformly from [max(0, 1 - brightness), 1 + brightness]. Should be non negative numbers. Chosen uniformly from [max(0, 1 - brightness), 1 + brightness]. Should be non negative numbers. Default: 0.
contrast (float): How much to jitter contrast. contrast (float, optional): How much to jitter contrast.
Chosen uniformly from [max(0, 1 - contrast), 1 + contrast]. Should be non negative numbers. Chosen uniformly from [max(0, 1 - contrast), 1 + contrast]. Should be non negative numbers. Default: 0.
saturation (float): How much to jitter saturation. saturation (float, optional): How much to jitter saturation.
Chosen uniformly from [max(0, 1 - saturation), 1 + saturation]. Should be non negative numbers. Chosen uniformly from [max(0, 1 - saturation), 1 + saturation]. Should be non negative numbers. Default: 0.
hue (float): How much to jitter hue. hue (float, optional): How much to jitter hue.
Chosen uniformly from [-hue, hue]. Should have 0<= hue <= 0.5. Chosen uniformly from [-hue, hue]. Should have 0<= hue <= 0.5. Default: 0.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
...@@ -1665,7 +1664,7 @@ class Grayscale(BaseTransform): ...@@ -1665,7 +1664,7 @@ class Grayscale(BaseTransform):
"""Converts image to grayscale. """Converts image to grayscale.
Args: Args:
num_output_channels (int): (1 or 3) number of channels desired for output image num_output_channels (int, optional): (1 or 3) number of channels desired for output image. Default: 1.
keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None. keys (list[str]|tuple[str], optional): Same as ``BaseTransform``. Default: None.
Shape: Shape:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册