`Check failed` in `tf.raw_ops.TensorScatterMax` and `tf.tensor_scatter_nd_max` when the rank of `indices` > 2.
@SuryanarayanaY I was able to replicate the issue reported [here](https://colab.research.google.com/gist/sushreebarsa/1d9902ec75874e268bd7af4045154969/-6_tf_raw_ops_tensorscattermax.ipynb).
Thank you!
### Issue type

Bug

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

Yes

### Source

binary

### TensorFlow version

tf 2.15

### Custom code

No

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

_No response_

### GPU model and memory

_No response_

### Current behavior?

`Check failed` in `tf.raw_ops.TensorScatterMax` and `tf.tensor_scatter_nd_max` when the rank of `indices` > 2, which causes the program to crash. See the colab link below for details.

### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1BvyImiXvq4Sr0CMTt--t6lRFy6bkGY8P?usp=sharing
```


### Relevant log output

```shell
Check failed: d < dims() (1 vs. 1)
```
