tf.transpose lead to program abortion on a normal value while the perm contains -1 
Hi, I want to have a quick update and draw your attention for this issue.
I recently occurred this issue again and find out that tf.transpose will even lead to program abortion on a very normal tensor that is not empty.

```
import tensorflow as tf
import numpy as np
input = tf.constant(np.random.rand(2,3))
dim0 = 0
dim1 = -1
tf.transpose(input, perm=[dim1, dim0])
```

When I set the dim1 to -1, which is a valid value for perm, this API will lead to a program abortion! @SuryanarayanaY I was able to replicate the issue reported [here](https://colab.research.google.com/gist/sushreebarsa/ef31e486f62f96d36322731804bb9606/63685.ipynb).
Thank you!
### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

2.15.0

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Hi, the tf.transpose will lead to a program abortion when receiving an empty input and perm is [-1, -2].
The traceback indicate a check fail:
```
tensorflow/core/framework/tensor_shape.cc:356] Check failed: d >= 0 (0 vs. -1)
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf

input = tf.constant([[]])
dim0 = -2
dim1 = -1
tf.transpose(input, perm=[dim1, dim0])
```


### Relevant log output

_No response_