Skip to content

Commit

Permalink
[fbsync] Make rotate_image_tensor's results fully BC with v1 (#7271)
Browse files Browse the repository at this point in the history
Reviewed By: vmoens

Differential Revision: D44416610

fbshipit-source-id: 94919a1f3cad30bb0f14945ef47d1c776f2359dc
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Mar 28, 2023
1 parent e1a8141 commit 0cfeb9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchvision/transforms/v2/functional/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,10 @@ def rotate_image_tensor(
center_f = [0.0, 0.0]
if center is not None:
if expand:
# TODO: Do we actually want to warn, or just document this?
warnings.warn("The provided center argument has no effect on the result if expand is True")
else:
# Center values should be in pixel coordinates but translated such that (0, 0) corresponds to image center.
center_f = [(c - s * 0.5) for c, s in zip(center, [width, height])]
# Center values should be in pixel coordinates but translated such that (0, 0) corresponds to image center.
center_f = [(c - s * 0.5) for c, s in zip(center, [width, height])]

# due to current incoherence of rotation angle direction between affine and rotate implementations
# we need to set -angle.
Expand Down

0 comments on commit 0cfeb9f

Please sign in to comment.