Skip to content

Commit

Permalink
Use is False for some antialias checks (#7234)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug authored Feb 14, 2023
1 parent 20f84bf commit 3a0e028
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torchvision/prototype/transforms/functional/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def resize(
elif isinstance(inpt, datapoints._datapoint.Datapoint):
return inpt.resize(size, interpolation=interpolation, max_size=max_size, antialias=antialias)
elif isinstance(inpt, PIL.Image.Image):
if antialias is not None and not antialias:
if antialias is False:
warnings.warn("Anti-alias option is always applied for PIL Image input. Argument antialias is ignored.")
return resize_image_pil(inpt, size, interpolation=interpolation, max_size=max_size)
else:
Expand Down
2 changes: 1 addition & 1 deletion torchvision/transforms/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def resize(
antialias = _check_antialias(img, antialias, interpolation)

if not isinstance(img, torch.Tensor):
if antialias is not None and not antialias:
if antialias is False:
warnings.warn("Anti-alias option is always applied for PIL Image input. Argument antialias is ignored.")
pil_interpolation = pil_modes_mapping[interpolation]
return F_pil.resize(img, size=output_size, interpolation=pil_interpolation)
Expand Down

0 comments on commit 3a0e028

Please sign in to comment.