### 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) Linux kali 6.11.2-amd64

### Mobile device

_No response_

### Python version

Python 3.10

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Executing tf.raw_ops.CollectiveGatherV2 on a CPU-only VMware virtual machine causes a native crash inside TensorFlow.

Before the crash, TensorFlow prints a cuInit(303) message (expected for a CPU-only machine), and then immediately hits a fatal C++ CHECK failure inside tensor_shape.cc:

2025-11-21 08:11:23.906652: 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 08:11:23.925656: F tensorflow/core/framework/tensor_shape.cc:587] Check failed: d < dims() (0 vs. 0)
zsh: IOT instruction  python q2.py


There is no Python exception.
The entire Python process aborts with an IOT instruction (SIGABRT) due to the failed CHECK.

This indicates a bug in the TensorShape handling logic inside CollectiveGatherV2.
For scalar inputs (shape=[]), the kernel attempts to access dimension 0, producing the illegal condition 0 < 0.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

tf.raw_ops.CollectiveGatherV2(
    input=tf.constant(1.0, dtype=tf.float32),
    group_size=tf.constant(1, dtype=tf.int32),
    group_key=tf.constant(0, dtype=tf.int32),
    instance_key=tf.constant(0, dtype=tf.int32),
    ordering_token=[]
)
```

### Relevant log output

```shell
2025-11-21 08:11:23.906652: 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 08:11:23.925656: F tensorflow/core/framework/tensor_shape.cc:587] Check failed: d < dims() (0 vs. 0)
zsh: IOT instruction  python q2.py
```