Aborted (core dumped) in `tf.raw_ops.ThreadUnsafeUnigramCandidateSampler/LearnedUnigramCandidateSampler`
Hi @x0w3n ,
- I was able to reproduce the issue on Colab using TF v2.15 and TF-nightly ,Please find the [gist](https://colab.research.google.com/gist/Venkat6871/bb0860f8ca2f02755ff47c36b6857502/69219_2-15-nightly-v.ipynb) here for reference.

Thank you!
 Thank you for your response. 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/69219">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/69219">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

tf 2.16

### Custom code

Yes

### OS platform and distribution

Linux Ubuntu 22.04.3 LTS (x86_64)

### Mobile device

_No response_

### Python version

3.9.13

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

A crash is triggered when input some boundary values to the range_max parameter of the tf.raw_ops.ThreadUnsafeUnigramCandidateSampler/LearnedUnigramCandidateSampler function.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np

true_classes = np.random.randint(0, 1000, size=(10, 1))
num_true = 1
num_sampled = 10
unique = True
range_max = (2 ** 32)
seed = 0
seed2 = 0

# crash
tf.raw_ops.ThreadUnsafeUnigramCandidateSampler(true_classes=true_classes, num_true=num_true, num_sampled=num_sampled, unique=unique, range_max=range_max, seed=seed, seed2=seed2)
# crash
# tf.raw_ops.LearnedUnigramCandidateSampler(true_classes=true_classes, num_true=num_true, num_sampled=num_sampled, unique=unique, range_max=range_max, seed=seed, seed2=seed2)
```


### Relevant log output

```shell
2024-06-05 10:33:44.105929: I tensorflow/core/platform/cpu_feature_guard.cc:210] 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.
2024-06-05 10:33:45.163653: F tensorflow/core/kernels/range_sampler.cc:183] Check failed: range < kint32max (4294967296 vs. 2147483647)
Aborted (core dumped)
```
