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
13d1a6cc
Commit
13d1a6cc
authored
Feb 15, 2018
by
vfdev
Committed by
Soumith Chintala
Feb 14, 2018
Browse files
Update functional.py (#421)
if on dtype -> elif on dtype
parent
f1b79d90
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 @
13d1a6cc
...
@@ -115,9 +115,9 @@ def to_pil_image(pic, mode=None):
...
@@ -115,9 +115,9 @@ def to_pil_image(pic, mode=None):
npimg
=
npimg
[:,
:,
0
]
npimg
=
npimg
[:,
:,
0
]
if
npimg
.
dtype
==
np
.
uint8
:
if
npimg
.
dtype
==
np
.
uint8
:
expected_mode
=
'L'
expected_mode
=
'L'
if
npimg
.
dtype
==
np
.
int16
:
el
if
npimg
.
dtype
==
np
.
int16
:
expected_mode
=
'I;16'
expected_mode
=
'I;16'
if
npimg
.
dtype
==
np
.
int32
:
el
if
npimg
.
dtype
==
np
.
int32
:
expected_mode
=
'I'
expected_mode
=
'I'
elif
npimg
.
dtype
==
np
.
float32
:
elif
npimg
.
dtype
==
np
.
float32
:
expected_mode
=
'F'
expected_mode
=
'F'
...
...
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