Repository: tensorflow
Issue: tf.raw_ops.BlockLSTMV2: tensorflow/core/framework/tensor.cc:1075] Check failed: 0 <= start (0 vs. -9) Aborted (core dumped) 
Labels: stat:awaiting tensorflower,type:bug,comp:ops,2.17

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

2.18.0.dev20240717

### Custom code

Yes

### OS platform and distribution

Ubuntu 20.04.3 LTS (x86_64)

### Mobile device

_No response_

### Python version

Python version: 3.10.14 

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I encountered a bug in TensorFlow when I used API `tf.raw_ops.BlockLSTMV2`  . The code is as follows:

```python
import tensorflow as tf

seq_len_max = tf.constant(5, shape=(), dtype=tf.int64)
x = tf.constant([[[8., 1.]],[[7., 6.]]], shape=(2, 1, 2), dtype=tf.float16)
cs_prev = tf.constant([[5., 3.]], shape=(1, 2), dtype=tf.float16)
h_prev = tf.constant([[3., 1.]], shape=(1, 2), dtype=tf.float16)
w = tf.constant([[  3.,  -1.,   7.,  -2.,  -8.,   2.,  -5.,   2.],
                 [ -3.,   2.,  -6.,  -4.,   0.,   0.,   2.,  -6.],
                 [-10.,   0.,   8.,   2.,  -1.,  -5.,   4.,  -7.],
                 [  1., -10.,  -6.,   2.,  -2., -10.,  -3.,   5.]], shape=(4, 8), dtype=tf.float16)

wci = tf.constant([ 7., -7.], shape=(2,), dtype=tf.float16)
wcf = tf.constant([-10., 7.], shape=(2,), dtype=tf.float16)
wco = tf.constant([-3., -5.], shape=(2,), dtype=tf.float16)
b = tf.constant([  1.,   6.,  -4.,  -2.,  -4.,   8., -10.,  -2.], shape=(8,), dtype=tf.float16)


tf.raw_ops.BlockLSTMV2(cell_clip=-10,use_peephole=True,seq_len_max=seq_len_max,x=x,cs_prev=cs_prev,h_prev=h_prev,w=w,wci=wci,wcf=wcf,wco=wco,b=b,)
```

The error message was as follows:

```shell
2024-07-23 20:47:52.963893: E tensorflow/core/util/util.cc:131] oneDNN supports DT_HALF only on platforms with AVX-512. Falling back to the default Eigen-based implementation if present.
2024-07-23 20:47:52.968139: F tensorflow/core/framework/tensor.cc:1075] Check failed: 0 <= start (0 vs. -9)
Aborted (core dumped)
```

The above code would crash on `tf-nightly 2.18.0.dev20240717` (nightly-build). To reproduce the issue, I provided that a [colab notebook](https://colab.research.google.com/drive/1UxYr3Fg7uKd_cZA-ekKrM9WsfJK-ox_Z?usp=sharing) to reproduce the error.

 

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

seq_len_max = tf.constant(5, shape=(), dtype=tf.int64)
x = tf.constant([[[8., 1.]],[[7., 6.]]], shape=(2, 1, 2), dtype=tf.float16)
cs_prev = tf.constant([[5., 3.]], shape=(1, 2), dtype=tf.float16)
h_prev = tf.constant([[3., 1.]], shape=(1, 2), dtype=tf.float16)
w = tf.constant([[  3.,  -1.,   7.,  -2.,  -8.,   2.,  -5.,   2.],
                 [ -3.,   2.,  -6.,  -4.,   0.,   0.,   2.,  -6.],
                 [-10.,   0.,   8.,   2.,  -1.,  -5.,   4.,  -7.],
                 [  1., -10.,  -6.,   2.,  -2., -10.,  -3.,   5.]], shape=(4, 8), dtype=tf.float16)

wci = tf.constant([ 7., -7.], shape=(2,), dtype=tf.float16)
wcf = tf.constant([-10., 7.], shape=(2,), dtype=tf.float16)
wco = tf.constant([-3., -5.], shape=(2,), dtype=tf.float16)
b = tf.constant([  1.,   6.,  -4.,  -2.,  -4.,   8., -10.,  -2.], shape=(8,), dtype=tf.float16)


tf.raw_ops.BlockLSTMV2(cell_clip=-10,use_peephole=True,seq_len_max=seq_len_max,x=x,cs_prev=cs_prev,h_prev=h_prev,w=w,wci=wci,wcf=wcf,wco=wco,b=b,)
```


### Relevant log output

```shell
2024-07-23 20:47:52.963893: E tensorflow/core/util/util.cc:131] oneDNN supports DT_HALF only on platforms with AVX-512. Falling back to the default Eigen-based implementation if present.
2024-07-23 20:47:52.968139: F tensorflow/core/framework/tensor.cc:1075] Check failed: 0 <= start (0 vs. -9)
Aborted (core dumped)
```