Skip to content

Commit

Permalink
fix fill=None workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed Nov 3, 2022
1 parent 3f841ca commit 1622cd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchvision/prototype/transforms/functional/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ def pad_image_tensor(
)

if fill is None:
# This is a JIT workaround
return _pad_with_scalar_fill(image, torch_padding, fill=0, padding_mode=padding_mode)
elif isinstance(fill, (int, float)):
fill = 0

if isinstance(fill, (int, float)):
return _pad_with_scalar_fill(image, torch_padding, fill=fill, padding_mode=padding_mode)
elif len(fill) == 1:
return _pad_with_scalar_fill(image, torch_padding, fill=fill[0], padding_mode=padding_mode)
Expand Down

0 comments on commit 1622cd6

Please sign in to comment.