Skip to content

Commit 537e650

Browse files
committed
restore int idiom
1 parent 843bcc9 commit 537e650

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/prototype/transforms/_geometry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,12 @@ def _get_params(self, flat_inputs: List[Any]) -> Dict[str, Any]:
448448
needs_pad = any(padding)
449449

450450
needs_vert_crop, top = (
451-
(True, torch.randint(0, padded_height - cropped_height + 1, size=()).item())
451+
(True, int(torch.randint(0, padded_height - cropped_height + 1, size=())))
452452
if padded_height > cropped_height
453453
else (False, 0)
454454
)
455455
needs_horz_crop, left = (
456-
(True, torch.randint(0, padded_width - cropped_width + 1, size=()).item())
456+
(True, int(torch.randint(0, padded_width - cropped_width + 1, size=()).item()))
457457
if padded_width > cropped_width
458458
else (False, 0)
459459
)

0 commit comments

Comments
 (0)