### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

tf 2.20.0

### Custom code

Yes

### OS platform and distribution

Kali Linux (kali-rolling) 

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

Calling tf.raw_ops.BlockLSTMGrad with minimal valid-rank tensors causes a fatal C++ CHECK failure:

Check failed: d < dims() (2 vs. 2)
zsh: IOT instruction  python p1.py


This is a process-terminating abort() from within TensorFlow's C++ runtime.
There is no Python exception, meaning TensorFlow attempts to index a TensorShape dimension out of bounds before any validation occurs.

This crash happens:

✔ In stable TensorFlow 2.20.0

✔ In tf-nightly (latest)

✔ On CPU-only hardware

✔ With a minimal reproducible example

✔ Without any Graph/XLA/CUDA involvement

✔ Inside the BlockLSTMGradOp C++ kernel

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

seq_len_max = tf.constant(1, dtype=tf.int64)
x = tf.constant([[[1.0]]], dtype=tf.float32)
cs_prev = tf.constant([[1.0]], dtype=tf.float32)
h_prev = tf.constant([[1.0]], dtype=tf.float32)
w = tf.constant([[1.0]], dtype=tf.float32)
wci = tf.constant([1.0], dtype=tf.float32)
wcf = tf.constant([1.0], dtype=tf.float32)
wco = tf.constant([1.0], dtype=tf.float32)
b = tf.constant([1.0], dtype=tf.float32)
i = tf.constant([[1.0]], dtype=tf.float32)
cs = tf.constant([[1.0]], dtype=tf.float32)
f = tf.constant([[1.0]], dtype=tf.float32)
o = tf.constant([[1.0]], dtype=tf.float32)
ci = tf.constant([[1.0]], dtype=tf.float32)
co = tf.constant([[1.0]], dtype=tf.float32)
h = tf.constant([[1.0]], dtype=tf.float32)
cs_grad = tf.constant([[1.0]], dtype=tf.float32)
h_grad = tf.constant([[1.0]], dtype=tf.float32)
use_peephole = True

result = tf.raw_ops.BlockLSTMGrad(
    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,
    i=i, cs=cs, f=f, o=o, ci=ci, co=co, h=h,
    cs_grad=cs_grad, h_grad=h_grad, use_peephole=use_peephole
)

print(result)
```

### Relevant log output

```shell
2025-11-21 09:13:27.695138: E external/local_xla/xla/stream_executor/cuda/cuda_platform.cc:51] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2025-11-21 09:13:27.743584: F tensorflow/core/framework/tensor_shape.cc:359] Check failed: d < dims() (2 vs. 2)
zsh: IOT instruction  python p1.py
```