### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

TF 2.21.0

### Custom code

Yes

### OS platform and distribution

Windows 11 x86_64

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

Running the following valid-looking raw op crashes the Python interpreter with a C++ CHECK failed:

F tensorflow/core/util/tensor_format.h:428]  
Check failed: index >= 0 && index < num_total_dims  
Invalid index from the dimension: 3, 0, C  


On Windows this terminates the process with:

Process finished with exit code -1073740791 (0xC0000409)


This is a native crash, not a Python exception.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
input_sizes = tf.constant([1, 2, 2, 1], dtype=tf.int32)
filter = tf.constant([1.0], dtype=tf.float32)
out_backprop = tf.constant([1.0], dtype=tf.float32)
tf.raw_ops.DepthwiseConv2dNativeBackpropInput(input_sizes=input_sizes, filter=filter, out_backprop=out_backprop, strides=[1, 1], padding='SAME')
```

### Relevant log output

```shell
E:\AI\miniconda\envs\tf-nightly\python.exe E:\daimajianyan\pythonProject\fl\t3.py 
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1763717376.604100   25544 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1763717383.208960   25544 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1763717384.579648   25544 cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
F0000 00:00:1763717384.600228   25544 tensor_format.h:428] Check failed: index >= 0 && index < num_total_dims Invalid index from the dimension: 3, 0, C
*** Check failure stack trace: ***
    @   00007FFF19CD2F52  (unknown)
    @   00007FFEEEE37EEE  (unknown)
    @   00007FFEF14E6F95  (unknown)
    @   00007FFEF14EF24F  (unknown)
    @   00007FFF1986BDAD  (unknown)
    @   00007FFF190952A7  (unknown)
    @   00007FFF16953D4B  (unknown)
    @   00007FFF1695F0F3  (unknown)
    @   00007FFF1697E4AA  (unknown)
    @   00007FFF16980D1E  (unknown)
    @   00007FFF190B4417  (unknown)
    @   00007FFF1695756D  (unknown)
    @   00007FFF169566C5  (unknown)
    @   00007FFF1695B1FB  (unknown)
    @   00007FFF1695B2CD  (unknown)
    @   00007FFF1693E7A6  (unknown)
    @   00007FFF169472DF  (unknown)
    @   00007FFF1CC4CCA6  (unknown)
    @   00007FFF1CBF141C  (unknown)
    @   00007FFF1CBFCC88  (unknown)
    @   00007FFF1D217B0B  (unknown)
    @   00007FFF1CBF0B0F  (unknown)
    @   00007FFF1CBEDEB4  (unknown)
    @   00007FFF1CBF1E9D  (unknown)
    @   00007FFF1C8618ED  (unknown)
    @   00007FFF1CC47E9E  (unknown)
    @   00007FFF1A351DAF  (unknown)
    @   00007FFF1A30E933  (unknown)
    @   00007FF8125D593D  (unknown)
    @   00007FF8125D5880  (unknown)
    @   00007FF8125AAE44  (unknown)
    @   00007FF801F5142D  (unknown)
    @   00007FF801F0C2C8  (unknown)
    @   00007FF802020E52  (unknown)
    @   00007FF80201D19D  (unknown)
    @   00007FF80201F52F  (unknown)
    @   00007FF801F0C67E  (unknown)
    @   00007FF801F0C3E1  (unknown)
    @   00007FF802021052  (unknown)
    @   00007FF80201BFB0  (unknown)
    @   00007FF80201F52F  (unknown)
    @   00007FF801F0C67E  (unknown)
    @   00007FF8020188E1  (unknown)
    @   00007FF802020E52  (unknown)
    @   00007FF80201D20E  (unknown)
    @   00007FF80201F52F  (unknown)
    @   00007FF8020926B1  (unknown)
    @   00007FF802092798  (unknown)
    @   00007FF802092398  (unknown)
    @   00007FF8020901BB  (unknown)
    @   00007FF801E8BA8A  (unknown)
    @   00007FF801E8C701  (unknown)
    @   00007FF801E8D453  (unknown)
    @   00007FF801E8D4C6  (unknown)
    @   00007FF72BF11490  (unknown)
    @   00007FF8C363E8D7  (unknown)
    @   00007FF8C4CEC53C  (unknown)

进程已结束，退出代码为 -1073740791 (0xC0000409)
```