Unverified Commit 8a820172 authored by Sanket Thakur's avatar Sanket Thakur Committed by GitHub
Browse files

fixed Gamma casting (#3472)



* fixed origin head

* fixed inconsistent casting

* updated functional_tensor.py

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

* Apply suggestions from code review
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent f637c63b
...@@ -227,7 +227,6 @@ def adjust_gamma(img: Tensor, gamma: float, gain: float = 1) -> Tensor: ...@@ -227,7 +227,6 @@ def adjust_gamma(img: Tensor, gamma: float, gain: float = 1) -> Tensor:
result = (gain * result ** gamma).clamp(0, 1) result = (gain * result ** gamma).clamp(0, 1)
result = convert_image_dtype(result, dtype) result = convert_image_dtype(result, dtype)
result = result.to(dtype)
return result return result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment