Aborted (core dumped) in `tf.raw_ops.QuantizeAndDequantizeV3`
@x0w3n I was able to replicate the issue reported here using TF [v2.16](https://colab.research.google.com/gist/sushreebarsa/fb81f8b4fc00adf53d71eb4c09b33208/69220-nightly.ipynb) and tf-[nightly](https://colab.research.google.com/gist/sushreebarsa/28d977cff6a884ff9c4a13ed84202b4c/69220-nightly.ipynb).
Thank you!
### 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 an unintended value is passed to the input parameter of the tf.raw_ops.QuantizeAndDequantizeV3 function.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

input_data = tf.random.uniform(shape=[2, 1], maxval=9.0)
input_min = tf.constant([0, 1.0], dtype=tf.dtypes.float32)
input_max = tf.constant([1.0], dtype=tf.dtypes.float32)
# crash
tf.raw_ops.QuantizeAndDequantizeV3(input=input_data, input_min=input_min, input_max=input_max, num_bits=8, signed_input=True, range_given=True, narrow_range=False, axis=(- 1))
```


### Relevant log output

```shell
2024-06-05 10:39:35.285635: 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:39:36.361982: F tensorflow/core/framework/tensor.cc:852] Check failed: 1 == NumElements() (1 vs. 2)Must have a one element tensor
Aborted (core dumped)
```
