Skip to content

Commit 198bd37

Browse files
committed
- Fixed incorrect docs layout and a warning
1 parent 51223c9 commit 198bd37

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/source/transforms.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ random transformations applied on the batch of Tensor Images identically transfo
1616

1717

1818
Scriptable transforms
19-
^^^^^^^^^^^^^^^^^^^^^
19+
---------------------
2020

2121
In order to script the transformations, please use ``torch.nn.Sequential`` instead of :class:`Compose`.
2222

@@ -33,6 +33,8 @@ Make sure to use only scriptable transformations, i.e. that work with ``torch.Te
3333

3434
For any custom transformations to be used with ``torch.jit.script``, they should be derived from ``torch.nn.Module``.
3535

36+
Compositions of transforms
37+
--------------------------
3638

3739
.. autoclass:: Compose
3840

torchvision/transforms/transforms.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ class ToPILImage:
161161
Args:
162162
mode (`PIL.Image mode`_): color space and pixel depth of input data (optional).
163163
If ``mode`` is ``None`` (default) there are some assumptions made about the input data:
164-
- If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
165-
- If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
166-
- If the input has 2 channels, the ``mode`` is assumed to be ``LA``.
167-
- If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``,
168-
``short``).
164+
- If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
165+
- If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
166+
- If the input has 2 channels, the ``mode`` is assumed to be ``LA``.
167+
- If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``,
168+
``short``).
169169
170170
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
171171
"""

0 commit comments

Comments
 (0)