Skip to content

Commit 6473b77

Browse files
authored
[docs] Clarify pad/crop order in RandomCrop (#9106)
1 parent a63221d commit 6473b77

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

torchvision/transforms/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class RandomCrop(torch.nn.Module):
589589
int instead of sequence like (h, w), a square crop (size, size) is
590590
made. If provided a sequence of length 1, it will be interpreted as (size[0], size[0]).
591591
padding (int or sequence, optional): Optional padding on each border
592-
of the image. Default is None. If a single int is provided this
592+
of the image, applied before cropping. Default is None. If a single int is provided this
593593
is used to pad all borders. If sequence of length 2 is provided this is the padding
594594
on left/right and top/bottom respectively. If a sequence of length 4 is provided
595595
this is the padding for the left, top, right and bottom borders respectively.

torchvision/transforms/v2/_geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ class RandomCrop(Transform):
769769
int instead of sequence like (h, w), a square crop (size, size) is
770770
made. If provided a sequence of length 1, it will be interpreted as (size[0], size[0]).
771771
padding (int or sequence, optional): Optional padding on each border
772-
of the image. Default is None. If a single int is provided this
772+
of the image, applied before cropping. Default is None. If a single int is provided this
773773
is used to pad all borders. If sequence of length 2 is provided this is the padding
774774
on left/right and top/bottom respectively. If a sequence of length 4 is provided
775775
this is the padding for the left, top, right and bottom borders respectively.

0 commit comments

Comments
 (0)