Skip to content

Commit 8257aff

Browse files
ekagra-ranjanfmassa
authored andcommitted
Update transform doc with random offset of padding due to pad_if_needed (#791)
* Update transform doc with random offset of padding due to pad_if_needed Updating transform docs with the random offset of padding when pad_if_needed is set to True. * Update docs
1 parent 138b5c2 commit 8257aff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchvision/transforms/transforms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ class RandomCrop(object):
397397
respectively. If a sequence of length 2 is provided, it is used to
398398
pad left/right, top/bottom borders, respectively.
399399
pad_if_needed (boolean): It will pad the image if smaller than the
400-
desired size to avoid raising an exception.
400+
desired size to avoid raising an exception. Since cropping is done
401+
after padding, the padding seems to be done at a random offset.
401402
fill: Pixel fill value for constant fill. Default is 0. If a tuple of
402403
length 3, it is used to fill R, G, B channels respectively.
403404
This value is only used when the padding_mode is constant

0 commit comments

Comments
 (0)