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
1fa2f866
"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "6eac421ca2ea1ca52f49e10d7ac191c0d6900df1"
Commit
1fa2f866
authored
Mar 24, 2019
by
ekka
Committed by
Francisco Massa
Mar 24, 2019
Browse files
change tensor to as_tensor (#810)
parent
6eac421c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/transforms/functional.py
torchvision/transforms/functional.py
+2
-2
No files found.
torchvision/transforms/functional.py
View file @
1fa2f866
...
...
@@ -203,8 +203,8 @@ def normalize(tensor, mean, std, inplace=False):
if
not
inplace
:
tensor
=
tensor
.
clone
()
mean
=
torch
.
tensor
(
mean
,
dtype
=
torch
.
float32
,
device
=
tensor
.
device
)
std
=
torch
.
tensor
(
std
,
dtype
=
torch
.
float32
,
device
=
tensor
.
device
)
mean
=
torch
.
as_
tensor
(
mean
,
dtype
=
torch
.
float32
,
device
=
tensor
.
device
)
std
=
torch
.
as_
tensor
(
std
,
dtype
=
torch
.
float32
,
device
=
tensor
.
device
)
tensor
.
sub_
(
mean
[:,
None
,
None
]).
div_
(
std
[:,
None
,
None
])
return
tensor
...
...
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