Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed Aug 31, 2023
1 parent 540dec5 commit eb451e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions torchvision/transforms/v2/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,16 @@ class RandomRotation(Transform):
expand (bool, optional): Optional expansion flag.
If true, expands the output to make it large enough to hold the entire rotated image.
If false or omitted, make the output image the same size as the input image.
Note that the expand flag assumes rotation around the center and no translation.
Note that the expand flag assumes rotation around the center (see note below) and no translation.
center (sequence, optional): Optional center of rotation, (x, y). Origin is the upper left corner.
Default is the center of the image.
..note::
In theory, ``center`` has no effect together with ``expand=True``. In practice however, this can lead to
off-by-one differences of the resulting image size compared to ``center=None``.
In theory, setting ``center`` has no effect if ``expand=True``, since the image center will become the
center of rotation. In practice however, due to numerical precision, this can lead to off-by-one
differences of the resulting image size compared to using the image center in the first place. Thus, when
setting ``expand=True``, it's best to leave ``center=None`` (default).
fill (number or tuple or dict, optional): Pixel fill value used when the ``padding_mode`` is constant.
Default is 0. If a tuple of length 3, it is used to fill R, G, B channels respectively.
Fill value can be also a dictionary mapping data type to the fill value, e.g.
Expand Down

0 comments on commit eb451e3

Please sign in to comment.