You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tf.while_loop condition with tuple indexing x[(0,0)] fails in eager but works under XLA [Recent/Qwen] #125538
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.20.0-dev0 (self-built, 20250806 snapshot)
Custom code
Yes
OS platform and distribution
Ubuntu 24.04.4 LTS (x86_64)
Mobile device
No response
Python version
3.12.3
Bazel version
Not recoverable from available build logs for this self-built wheel.
GCC/compiler version
gcc 13.3.0
CUDA/cuDNN version
CPU-only environment
GPU model and memory
CPU-only environment
Current behavior?
A tf.while_loop condition indexes its loop variable with x[(0, 0)], valid 2D indexing into a (1, 1) tensor. In eager, this raises IndexError claiming the tensor only has 1 dimension. Under jit_compile=True and under autoclustering, the same code runs fine and both agree on the result.
eager:
FAILED: Index out of range using input dim 1; input has only 1 dims [Op:StridedSlice]
jit_compile=True: [<tf.Tensor: shape=(1, 1), dtype=float32, numpy=array([[0.]], dtype=float32)>]
Activity
Kayyuri commentedon Aug 20, 2026
Hi @MRiffiAslett, Thank you for reporting this issue!
A PR has been submitted to fix this issue, and it will be resolved once merged.
Thank you to @AnupamKumar-1 for working on the fix contributions.
google-ml-butler commentedon Aug 31, 2026
Are you satisfied with the resolution of your issue?
Yes
No