Skip to content

tf.tuple() given a flat list of the same Variable raises "Tensor.op is undefined when eager execution is enabled" under jit_compile=True and autoclustering [Original/StarCoder] #125397

Closed

Description

@MRiffiAslett

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

2.14.0 (self-built, 20230507 snapshot)

Custom code

Yes

OS platform and distribution

Ubuntu 24.04.4 LTS (x86_64)

Mobile device

No response

Python version

3.10.20

Bazel version

5.3.0

GCC/compiler version

clang 17.0.6

CUDA/cuDNN version

CPU-only environment

GPU model and memory

CPU-only environment

Current behavior?

tf.tuple() called with a flat list containing the same tf.Variable three times, then tf.identity() on the result, works fine under eager but raises under both jit_compile=True and autoclustering:

eager : [[10.0, 20.0], [10.0, 20.0], [10.0, 20.0]]
xla   : FAILED: AttributeError: Tensor.op is undefined when eager execution is enabled.
ac    : FAILED: AttributeError: Tensor.op is undefined when eager execution is enabled.

The message itself is backwards — it blames eager execution being enabled, but eager is the mode that actually works here.

Not the same as #124879 (closed, fixed by #124931): that one was about nested tuple input, different exception class (ValueError). This input is already flat, and #124931 explicitly scopes itself to nested structures only, so it doesn't look like it covers this path — checked the merged diff to confirm before filing.

Standalone code to reproduce the issue

import tensorflow as tf
print("tf    :", tf.__version__)

x1 = tf.Variable([10.0, 20.0])

def compute():
    grouped = tf.tuple([x1, x1, x1])
    return tf.identity(grouped)

print("eager :", [t.numpy().tolist() for t in compute()])
try:
    print("xla   :", [t.numpy().tolist() for t in tf.function(compute, jit_compile=True)()])
except Exception as e:
    print("xla   : FAILED:", str(e).strip().splitlines()[-1])
try:
    print("ac    :", [t.numpy().tolist() for t in tf.function(compute)()])  # run with TF_XLA_FLAGS=--tf_xla_auto_jit=2
except Exception as e:
    print("ac    : FAILED:", str(e).strip().splitlines()[-1])

Relevant log output

tf    : 2.14.0
eager : [[10.0, 20.0], [10.0, 20.0], [10.0, 20.0]]
xla   : FAILED: AttributeError: Tensor.op is undefined when eager execution is enabled.
ac    : FAILED: AttributeError: Tensor.op is undefined when eager execution is enabled.

Activity

  1. added
    comp:ops
    TF2.14
    on Aug 17, 2026
  2. Venkat6871 commented on Aug 17, 2026

    @Venkat6871
    Contributor

    Hi @MRiffiAslett ,
    Thank you for raising your concern here.
    A fix for this issue has been proposed in this PR. Once it is merged, this issue will be resolved.

    Hi @AnupamKumar-1 ,
    Thank you for raising the PR to address this issue. We truly appreciate your initiative and the effort in contributing the fix.

  3. google-ml-butler commented on Aug 21, 2026

    @google-ml-butler

    Are you satisfied with the resolution of your issue?
    Yes
    No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TF2.14awaiting PR mergecomp:opstype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions