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
67681a76
Unverified
Commit
67681a76
authored
Feb 23, 2021
by
Francisco Massa
Committed by
GitHub
Feb 23, 2021
Browse files
[FBcode->GH] Fix to_tensor for accimage backend (#3439)
parent
a7b4bfd6
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 @
67681a76
...
...
@@ -119,9 +119,9 @@ def to_tensor(pic):
return
img
if
accimage
is
not
None
and
isinstance
(
pic
,
accimage
.
Image
):
nppic
=
np
.
zeros
([
pic
.
channels
,
pic
.
height
,
pic
.
width
],
dtype
=
default_float_dtype
)
nppic
=
np
.
zeros
([
pic
.
channels
,
pic
.
height
,
pic
.
width
],
dtype
=
np
.
float32
)
pic
.
copyto
(
nppic
)
return
torch
.
from_numpy
(
nppic
)
return
torch
.
from_numpy
(
nppic
)
.
to
(
dtype
=
default_float_dtype
)
# handle PIL Image
if
pic
.
mode
==
'I'
:
...
...
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