Skip to content

Commit

Permalink
[fbsync] fixed Gamma casting (#3472)
Browse files Browse the repository at this point in the history
Summary:
* fixed origin head

* fixed inconsistent casting

* updated functional_tensor.py

Modified the .to() method to convert_image_dtype() method.

* Apply suggestions from code review

Reviewed By: NicolasHug, cpuhrsch

Differential Revision: D26945731

fbshipit-source-id: eab2e30c37bc1d29cae2d0921c869af22b49866a

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
  • Loading branch information
2 people authored and facebook-github-bot committed Mar 10, 2021
1 parent 2b2fc2f commit a68fa20
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion torchvision/transforms/functional_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def adjust_gamma(img: Tensor, gamma: float, gain: float = 1) -> Tensor:
result = (gain * result ** gamma).clamp(0, 1)

result = convert_image_dtype(result, dtype)
result = result.to(dtype)
return result


Expand Down

0 comments on commit a68fa20

Please sign in to comment.