A check fail can be triggered in StatelessRandomGammaV2
@SuryanarayanaY 
I was able to reproduce the issue on Coalb using TF v2.12 and tf-nightly. Please find the gist of [tf-nightly](https://colab.research.google.com/gist/tiruk007/4ee179e7a10dc5bbdb4e8df74faf72b4/nightly.ipynb) and [2.12](https://colab.research.google.com/gist/tiruk007/36a4995d912f43acec5185fa2467d781/2-12.ipynb) for reference.

Thank you ! Checked in tf-nightly(2.15.0-dev20231004).Check fail with crash observed.


<img width="1512" alt="Screenshot 2023-10-04 at 3 24 58 PM" src="https://github.com/tensorflow/tensorflow/assets/116063290/b240b4a7-0953-4165-8fc6-80942504f6a4">


 Issue persists in current nightly also.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

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

Yes

### Source

binary

### Tensorflow Version

2.13.0-dev20230331

### Custom Code

Yes

### OS Platform and Distribution

Linux Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.10

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

CUDA 11.8

### GPU model and memory

_No response_

### Current Behaviour?

```shell
The following code can trigger a crash in `tf.raw_ops.StatelessRandomGammaV2` due to check-fail in the latest version of TensorFlow.
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
with tf.device("GPU:0"):
    shape = [94, 47, 76, 127, 90]
    seed = tf.saturate_cast(tf.random.uniform([2], minval=-1024, maxval=1024, dtype=tf.int64), dtype=tf.int32)
    alpha = tf.saturate_cast(tf.random.uniform([], minval=-1024, maxval=1024, dtype=tf.int64), dtype=tf.half)
    res = tf.raw_ops.StatelessRandomGammaV2(
        shape=shape,
        seed=seed,
        alpha=alpha,
    )
```


### Relevant log output

```shell
2023-04-01 16:17:25.774398: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-04-01 16:17:25.823488: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-01 16:17:26.620798: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-04-01 16:17:28.156561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 14561 MB memory:  -> device: 0, name: Tesla V100-PCIE-16GB, pci bus id: 0000:2f:00.0, compute capability: 7.0
2023-04-01 16:17:28.418600: F ./tensorflow/core/util/gpu_launch_config.h:129] Check failed: work_element_count >= 0 (0 vs. -457139056)
Aborted (core dumped)
```
</details>