Inconsistency-bug in `tf.raw_ops.AdjustContrastv2` between jit mode and normal mode
https://colab.research.google.com/drive/1hIBJgTy9YCUJFhUFzrRoL1MpsgjnQdgA?usp=sharing
You can see this notebook in Colab. Hope this will be helpful. Thanks for your reply!
But I'm thinking that if the results should be equal no matter it is under jit compile or not which means for the same input, it should not produce different results?  You are right. I understand the point now 
Reducing the value of maxval to 1000 produces the same results for both functions. Large values can sometimes cause numerical instability in floating-point computations. The difference increases as the maxval becomes bigger. I think there is no bug, it’s just the way that the XLA compiler optimizes the function when it is compiled @Lyutoon,
I tried to execute the mentioned code with the maxval==1000, and it was executed without any issue/error. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/fe55ac7c58f73db923d2d8bbe2665b06/untitled1187.ipynb).

Whereas when I tried to provide the large input for the maxval it is failing with the assertion error.
maxval: A Tensor or Python value of type dtype, broadcastable with shape (for integer types, broadcasting is not supported, so it needs to be a scalar). The upper bound on the range of random values to generate (exclusive). Defaults to 1 if dtype is floating point.
https://www.tensorflow.org/api_docs/python/tf/random/uniform

Using all available RAM is not an issue that we should spend time on, since in this case this is similar to user calling **malloc(a_very_huge_number)** and then expecting this to work.

There's a difference if a small input can generate a large memory allocation, but this doesn't seem to be case. Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. 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/60766">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/60766">No</a>

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

Bug

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

Yes

### Source

source

### Tensorflow Version

2.14.0

### Custom Code

Yes

### OS Platform and Distribution

Ubuntu 20.04

### Mobile device

Ubuntu 20.04

### Python version

3.8.10

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

There is an inconsistency bug between **jit compile mode** and **normal mode** in `tf.raw_ops.AdjustContrastv2` which result in inconsistent computational result.

### Standalone code to reproduce the issue

```shell
import os 
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import numpy as np

images=tf.random.uniform([1, 1, 1], dtype=tf.dtypes.float32, maxval=100000000)
contrast_factor=tf.random.uniform([], dtype=tf.dtypes.float32, maxval=100000000)

@tf.function(jit_compile=True)
def fuzz_jit():
    y = tf.raw_ops.AdjustContrastv2(
        images = images,
        contrast_factor=contrast_factor
    )
    return y

def fuzz_normal():
    y = tf.raw_ops.AdjustContrastv2(
        images = images,
        contrast_factor=contrast_factor
    )
    return y

y1 = fuzz_jit()
print('[+] JIT ok')
y2 = fuzz_normal()
print('[+] Normal ok')
np.testing.assert_allclose(y1.numpy(), y2.numpy(), rtol=1e-4, atol=1e-4) # cause extramely different output
```


### Relevant log output

```shell
% python test.py
[+] JIT ok
[+] Normal ok
Traceback (most recent call last):
  File "test.py", line 28, in <module>
    np.testing.assert_allclose(y1.numpy(), y2.numpy(), rtol=1e-4, atol=1e-4)
  File "/usr/local/lib/python3.8/dist-packages/numpy/testing/_private/utils.py", line 1530, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
  File "/usr/local/lib/python3.8/dist-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=0.0001, atol=0.0001

Mismatched elements: 1 / 1 (100%)
Max absolute difference: 1.6265184e+08
Max relative difference: 2.9464307
 x: array([[[-1.074488e+08]]], dtype=float32)
 y: array([[[55203008.]]], dtype=float32)
```
</details>