Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
3d0c7794
Unverified
Commit
3d0c7794
authored
Oct 05, 2020
by
vfdev
Committed by
GitHub
Oct 05, 2020
Browse files
Fixes #2738 (#2757)
- Fixed incorrect docs layout and a warning
parent
7d872968
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
docs/source/transforms.rst
docs/source/transforms.rst
+3
-1
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+5
-5
No files found.
docs/source/transforms.rst
View file @
3d0c7794
...
...
@@ -16,7 +16,7 @@ random transformations applied on the batch of Tensor Images identically transfo
Scriptable transforms
^^^^^^^^^^^^^^^^^^^^^
---------------------
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
For any custom transformations to be used with ``torch.jit.script``, they should be derived from ``torch.nn.Module``.
Compositions of transforms
--------------------------
.. autoclass:: Compose
...
...
torchvision/transforms/transforms.py
View file @
3d0c7794
...
...
@@ -161,11 +161,11 @@ class ToPILImage:
Args:
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 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 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``,
``short``).
- 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 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``,
``short``).
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment