Skip to content

Commit c58d151

Browse files
committed
Fixes potential issue with inplace op
- fixes irreproducible failing test on Travis CI
1 parent e8b5f28 commit c58d151

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

torchvision/transforms/functional_tensor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ def adjust_hue(img: Tensor, hue_factor: float) -> Tensor:
194194

195195
img = _rgb2hsv(img)
196196
h, s, v = img.unbind(0)
197-
h += hue_factor
198-
h = h % 1.0
197+
h = torch.fmod(h + hue_factor, 1.0)
199198
img = torch.stack((h, s, v))
200199
img_hue_adj = _hsv2rgb(img)
201200

0 commit comments

Comments
 (0)