the output of tf.image.adjust_gamma is different in CPU and GPU
@cheyennee,

**tf.image.adjust_gamma** converts the input images at first to float representation, then transforms them pixelwise according to the equation **Out = gain * In**gamma**, and then converts the back to the original data type. I suspect that the problem here might be due to -ve value provided for the image_1. 

When I tried with the different +ve and -ve data, I was able to get the output for the +ve values. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/580e3184139a87bf2653b3e4b55d5031/untitled1139.ipynb). Thank you!

 @tilakrayal  I agree with you. But I think CPU should output the same result with GPU. @cheyennee,
The issue might be due to casting behaviour on CPU vs GPU with undefined/overflow values.

Could you please refer to the developer comment for a similar issue https://github.com/tensorflow/tensorflow/issues/58749#issuecomment-1467086661. Thank you! @tilakrayal Sure. You have done a great job. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60533">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60533">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

tf 2.12.0

### Custom Code

Yes

### OS Platform and Distribution

win11

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

I'm not sure if this is a bug as following snippet shows. The results on GPU is different from on CPU.

### Standalone code to reproduce the issue

```shell
results = dict()
import tensorflow as tf
with tf.device('/CPU'):
  image_0 = 1024
  image_1 = -1
  image = (image_0,image_1,)
  gamma = 0.2
  results["res_cpu"] = tf.image.adjust_gamma(image=image,gamma=gamma,)
with tf.device('/GPU:0'):
  image = (image_0,image_1,)
  results["res_gpu"] = tf.image.adjust_gamma(image=image,gamma=gamma,)
print(results)
# results={'res_cpu': <tf.Tensor: shape=(2,), dtype=int32, numpy=array([  116843312, -2147483648], dtype=int32)>, 'res_gpu': <tf.Tensor: shape=(2,), dtype=int32, numpy=array([116843320,         0], dtype=int32)>}
```


### Relevant log output

_No response_</details>