Skip to content
Snippets Groups Projects
Commit caeabcf6 authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[doc] More changes on transforms docstrings

parent 791e4152
No related branches found
No related tags found
1 merge request!15Update documentation
......@@ -13,8 +13,8 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
If the image is already in RGB format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in grayscale format
(number of channels = 1), then triplicate that channel 3 times (a new copy is
returned in this case).
(number of color channels = 1), then replicate it to obtain 3 color channels
(a new copy is returned in this case).
Parameters
......@@ -28,7 +28,7 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
-------
img
Transformed tensor with the channel dimension replicated 3 times.
Transformed tensor with 3 identical color channels.
"""
if img.ndim < 3:
raise TypeError(
......@@ -56,9 +56,9 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor:
"""Converts an image in RGB to grayscale.
If the image is already in grayscale format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in RGB format, then
compresses the color channels into a single grayscale channel
following this equation:
tensor is returned (no cloning). If the image is in RGB format
(number of color channels = 3), then compresses the color channels into
a single grayscale channel following this equation:
.. math::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment