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
c9e0fdd0
Unverified
Commit
c9e0fdd0
authored
Mar 10, 2021
by
Nicolas Hug
Committed by
GitHub
Mar 10, 2021
Browse files
use ternary if (#3533)
parent
afc502bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
torchvision/transforms/functional_tensor.py
torchvision/transforms/functional_tensor.py
+1
-5
No files found.
torchvision/transforms/functional_tensor.py
View file @
c9e0fdd0
...
@@ -498,11 +498,7 @@ def resize(img: Tensor, size: List[int], interpolation: str = "bilinear", max_si
...
@@ -498,11 +498,7 @@ def resize(img: Tensor, size: List[int], interpolation: str = "bilinear", max_si
if
isinstance
(
size
,
int
)
or
len
(
size
)
==
1
:
# specified size only for the smallest edge
if
isinstance
(
size
,
int
)
or
len
(
size
)
==
1
:
# specified size only for the smallest edge
short
,
long
=
(
w
,
h
)
if
w
<=
h
else
(
h
,
w
)
short
,
long
=
(
w
,
h
)
if
w
<=
h
else
(
h
,
w
)
requested_new_short
=
size
if
isinstance
(
size
,
int
)
else
size
[
0
]
if
isinstance
(
size
,
int
):
requested_new_short
=
size
else
:
requested_new_short
=
size
[
0
]
if
short
==
requested_new_short
:
if
short
==
requested_new_short
:
return
img
return
img
...
...
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