Skip to content

Commit 0cfeb9f

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Make rotate_image_tensor's results fully BC with v1 (#7271)
Reviewed By: vmoens Differential Revision: D44416610 fbshipit-source-id: 94919a1f3cad30bb0f14945ef47d1c776f2359dc
1 parent e1a8141 commit 0cfeb9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torchvision/transforms/v2/functional/_geometry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,10 @@ def rotate_image_tensor(
832832
center_f = [0.0, 0.0]
833833
if center is not None:
834834
if expand:
835+
# TODO: Do we actually want to warn, or just document this?
835836
warnings.warn("The provided center argument has no effect on the result if expand is True")
836-
else:
837-
# Center values should be in pixel coordinates but translated such that (0, 0) corresponds to image center.
838-
center_f = [(c - s * 0.5) for c, s in zip(center, [width, height])]
837+
# Center values should be in pixel coordinates but translated such that (0, 0) corresponds to image center.
838+
center_f = [(c - s * 0.5) for c, s in zip(center, [width, height])]
839839

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

0 commit comments

Comments
 (0)