Unverified Commit 3d0c7794 authored by vfdev's avatar vfdev Committed by GitHub
Browse files

Fixes #2738 (#2757)

- Fixed incorrect docs layout and a warning
parent 7d872968
...@@ -16,7 +16,7 @@ random transformations applied on the batch of Tensor Images identically transfo ...@@ -16,7 +16,7 @@ random transformations applied on the batch of Tensor Images identically transfo
Scriptable transforms Scriptable transforms
^^^^^^^^^^^^^^^^^^^^^ ---------------------
In order to script the transformations, please use ``torch.nn.Sequential`` instead of :class:`Compose`. In order to script the transformations, please use ``torch.nn.Sequential`` instead of :class:`Compose`.
...@@ -33,6 +33,8 @@ Make sure to use only scriptable transformations, i.e. that work with ``torch.Te ...@@ -33,6 +33,8 @@ Make sure to use only scriptable transformations, i.e. that work with ``torch.Te
For any custom transformations to be used with ``torch.jit.script``, they should be derived from ``torch.nn.Module``. For any custom transformations to be used with ``torch.jit.script``, they should be derived from ``torch.nn.Module``.
Compositions of transforms
--------------------------
.. autoclass:: Compose .. autoclass:: Compose
......
...@@ -161,11 +161,11 @@ class ToPILImage: ...@@ -161,11 +161,11 @@ class ToPILImage:
Args: Args:
mode (`PIL.Image mode`_): color space and pixel depth of input data (optional). mode (`PIL.Image mode`_): color space and pixel depth of input data (optional).
If ``mode`` is ``None`` (default) there are some assumptions made about the input data: If ``mode`` is ``None`` (default) there are some assumptions made about the input data:
- If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``. - If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
- If the input has 3 channels, the ``mode`` is assumed to be ``RGB``. - If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
- If the input has 2 channels, the ``mode`` is assumed to be ``LA``. - If the input has 2 channels, the ``mode`` is assumed to be ``LA``.
- If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``, - If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``,
``short``). ``short``).
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes .. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
""" """
......
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