A check fail can be triggered in tf.ragged.range
@gaikwadrahul8 
I was able to reproduce the issue on Colab using TF 2.11 and tf-nightly. Please find the gist of [2.11](https://colab.research.google.com/gist/tiruk007/cc8ffbbf3cc69f51227cc4ae93b7c078/untitled149.ipynb) and [tf-nightly](https://colab.research.google.com/gist/tiruk007/739b3634108ad660e60f8769fe1d2284/untitled149-nightly.ipynb) for reference. 
Thank you ! Hi, @shijy16 

Apologize for the delay and I was able to replicate the same issue on Google Colab with `tf-nightly `and `tensorflow==2.12.0rc0` and code is not executing completely successfully, Here is [gist-file](https://colab.research.google.com/gist/gaikwadrahul8/88dc21f81d4fbfe850ea8dfda20f56cb/-59844-test.ipynb) and session is getting crashed. It's giving warning `2023-03-03 15:03:16.216167: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648`, for your reference I have added screenshot below:

![image](https://user-images.githubusercontent.com/115997457/222754403-150c6ba0-b01c-4ddf-ada8-6429b3d8ad0d.png)

I have executed the same code multiple times on `Ubuntu 20.04` with `tf-nightly` and `tensorflow==2.12.0rc0` I have added detailed log below, It seems like we have to dig more into this issue and we'll update you soon, Thank you for noticing this issue. Thank you!

```
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:10.809221: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:11.628435: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:12.447280: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:12.447673: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:12.592711: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
<tf.RaggedTensor [[], [], [], [], [], [], [], [], [], [], []]>
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:17.896998: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:18.697086: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:19.442879: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:19.443243: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:19.453230: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-03-03 15:20:19.476306: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648
Aborted (core dumped)
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:26.245838: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:27.079848: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:27.877856: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:27.878182: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:27.888476: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-03-03 15:20:27.911686: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648
Aborted (core dumped)
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:32.161218: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:32.984919: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:33.728023: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:33.728350: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:33.738221: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-03-03 15:20:33.761200: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648
Aborted (core dumped)
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:39.988125: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:40.836736: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:41.593577: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:41.593877: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:41.603714: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
<tf.RaggedTensor [[], [], [], [], [], [], [], [], [], [], []]>
(tf-cpu-tf-nightly) gaikwadrahul@rahul-ubuntu-20-gpu:~$ python _59844_test.py 
2023-03-03 15:20:50.296064: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-03 15:20:51.125175: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-03 15:20:51.897238: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:51.897710: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-03-03 15:20:51.907990: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-03-03 15:20:51.931164: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648
Aborted (core dumped)

``` Hi, @SuryanarayanaY 

Could you please look into this issue ? Thank you! Hi @shijy16 ,

The issue got resolved now with tf-nightly(2.14.0-dev20230514) and now TF is successfully able to raise the intended Error.
Please refer to attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/85f3d42c0ec2d25e26093ea3f2ae32c9/59844_tf-nightly-2-14.ipynb). 

Please check and confirm and let us know if we can close the issue as it resolved now. 

Thanks! 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/59844">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/59844">No</a>

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

Bug

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

Yes

### Source

binary

### Tensorflow Version

tf 2.9 and 2.13.0-dev20230219

### 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.5

### GPU model and memory

_No response_

### Current Behaviour?

```shell
The following code can trigger a check fail in `tf.ragged.range`. In some cases, it executed and exited normally, but sometimes it failed with a check fail. The large values in `limits` might be the cause of this bug.
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
with tf.device("CPU"):
    Tsplits = tf.int32
    starts = tf.random.uniform([], dtype=tf.float32, minval=-1024, maxval=1024)
    limits = tf.random.uniform([11], dtype=tf.float32, minval=-18446744073709551615, maxval=18446744073709551615)
    deltas = tf.random.uniform([], dtype=tf.float32, minval=-1024, maxval=1024)
    res = tf.ragged.range(
        starts=starts,
        limits=limits,
        deltas=deltas,
        row_splits_dtype=tf.int32,
    )
```


### Relevant log output

```shell
2023-03-01 10:51:07.788154: 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-03-01 10:51:07.833699: 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-03-01 10:51:08.584794: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-03-01 10:51:09.415873: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.194653: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.194691: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 14061 MB memory:  -> device: 0, name: Tesla V100-PCIE-16GB, pci bus id: 0000:2f:00.0, compute capability: 7.0
2023-03-01 10:51:10.215308: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.221055: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.223571: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.225320: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.228201: I tensorflow/core/common_runtime/local_device.cc:158] LocalDevice using CPU work thread pool: 0x55d03db40440, num_threads=48
2023-03-01 10:51:10.230234: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -2147483648
Aborted (core dumped)
```
</details>