Unverified Commit c9e0fdd0 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

use ternary if (#3533)

parent afc502bd
......@@ -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
short, long = (w, h) if w <= h else (h, w)
if isinstance(size, int):
requested_new_short = size
else:
requested_new_short = size[0]
requested_new_short = size if isinstance(size, int) else size[0]
if short == requested_new_short:
return img
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment