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
cf65f394
"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "775dd2d8f8e1bdba6178be88092edd420c5caea2"
Commit
cf65f394
authored
May 27, 2018
by
Holger Kohr
Committed by
Francisco Massa
May 27, 2018
Browse files
Add note on in-place nature of Normalize, closes #517 (#520)
parent
b1ef1fe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
torchvision/transforms/functional.py
torchvision/transforms/functional.py
+3
-0
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+3
-0
No files found.
torchvision/transforms/functional.py
View file @
cf65f394
...
@@ -151,6 +151,9 @@ def to_pil_image(pic, mode=None):
...
@@ -151,6 +151,9 @@ def to_pil_image(pic, mode=None):
def
normalize
(
tensor
,
mean
,
std
):
def
normalize
(
tensor
,
mean
,
std
):
"""Normalize a tensor image with mean and standard deviation.
"""Normalize a tensor image with mean and standard deviation.
.. note::
This transform acts in-place, i.e., it mutates the input tensor.
See :class:`~torchvision.transforms.Normalize` for more details.
See :class:`~torchvision.transforms.Normalize` for more details.
Args:
Args:
...
...
torchvision/transforms/transforms.py
View file @
cf65f394
...
@@ -123,6 +123,9 @@ class Normalize(object):
...
@@ -123,6 +123,9 @@ class Normalize(object):
will normalize each channel of the input ``torch.*Tensor`` i.e.
will normalize each channel of the input ``torch.*Tensor`` i.e.
``input[channel] = (input[channel] - mean[channel]) / std[channel]``
``input[channel] = (input[channel] - mean[channel]) / std[channel]``
.. note::
This transform acts in-place, i.e., it mutates the input tensor.
Args:
Args:
mean (sequence): Sequence of means for each channel.
mean (sequence): Sequence of means for each channel.
std (sequence): Sequence of standard deviations for each channel.
std (sequence): Sequence of standard deviations for each channel.
...
...
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