Aborted (core dumped) in `TensorScatterOp`
Hi @LongZE666 ,

Thanks for reporting. I have reproduced the reported behaviour and attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/b454d163eb8d9e42ef83b4ed9d2dee9d/66768.ipynb) here.

The checkfail happening with empty inputs for `indices` and `updates` .

Attaching snapshot of same below.

<img width="1499" alt="Screenshot 2024-05-02 at 9 28 41 AM" src="https://github.com/tensorflow/tensorflow/assets/116063290/7f58dd18-f0f2-44dd-a6a7-3950cf56de8e">

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

tf 2.16.1

### Custom code

Yes

### OS platform and distribution

Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.11

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

The dimensions of `indices` and `updates` must be equal.If not equal,`tf.raw
_ops.TensorScatterSub,tf.raw
_ops.TensorScatterAdd,tf.raw
_ops.TensorScatterMin,tf.raw
_ops.TensorScatterMax,tf.raw
_ops.TensorScatterUpdate ` will crash.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

tensor = tf.constant(0, shape=[101,32], dtype=tf.float32)
indices = tf.constant([], shape=[0,0,0,6], dtype=tf.int32)
updates = tf.constant([], shape=[0,0], dtype=tf.float32)
tf.raw_ops.TensorScatterAdd(tensor=tensor, indices=indices, updates=updates)
```
```
import tensorflow as tf

tensor = tf.constant(0, shape=[101,32], dtype=tf.float32)
indices = tf.constant([], shape=[0,0,0,6], dtype=tf.int32)
updates = tf.constant([], shape=[0,0], dtype=tf.float32)
tf.raw_ops.TensorScatterMax(tensor=tensor, indices=indices, updates=updates)
```
```
import tensorflow as tf

tensor = tf.constant(0, shape=[101,32], dtype=tf.float32)
indices = tf.constant([], shape=[0,0,0,6], dtype=tf.int32)
updates = tf.constant([], shape=[0,0], dtype=tf.float32)
tf.raw_ops.TensorScatterMin(tensor=tensor, indices=indices, updates=updates)
```
```
import tensorflow as tf

tensor = tf.constant(0, shape=[101,32], dtype=tf.float32)
indices = tf.constant([], shape=[0,0,0,6], dtype=tf.int32)
updates = tf.constant([], shape=[0,0], dtype=tf.float32)
tf.raw_ops.TensorScatterSub(tensor=tensor, indices=indices, updates=updates)
```
```
import tensorflow as tf

tensor = tf.constant(0, shape=[101,32], dtype=tf.float32)
indices = tf.constant([], shape=[0,0,0,6], dtype=tf.int32)
updates = tf.constant([], shape=[0,0], dtype=tf.float32)
tf.raw_ops.TensorScatterUpdate(tensor=tensor, indices=indices, updates=updates)
```
```


### Relevant log output

```shell
2024-05-01 04:00:48.333921: F tensorflow/core/framework/tensor_shape.cc:357] Check failed: d < dims() (2 vs. 2)
Aborted (core dumped)
```
