`Check failed` in `tf.raw_ops.LoadAndRemapMatrix` when the rank of `ckpt_path` is not equal to the rank of `old_tensor_name`.
Hi @xl1043237213 ,

I have replicated the reported behaviour with tf-nightly and attached screenshot below. [Gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/b36eca39f8e238780c23b51eee4cfc22/copy-of-65731.ipynb)

<img width="1485" alt="Screenshot 2024-04-16 at 1 19 47 PM" src="https://github.com/tensorflow/tensorflow/assets/116063290/681bbe8d-b851-4ab9-a62f-21535f3cc6a8">

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

When the rank of `ckpt_path` is not equal to the rank of `old_tensor_name`, `tf.raw_ops.LoadAndRemapMatrix` triggers `Check fail` error.

### Standalone code to reproduce the issue

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


### Relevant log output

```shell
Check failed: NDIMS == dims() (1 vs. 0)Asking for tensor of 1 dimensions from a tensor of 0 dimensions
```
