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.math.bincount with negative values raises in eager but silently returns an empty tensor with jit_compile=True #117960
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
tf 2.21
Custom code
Yes
OS platform and distribution
No response
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
tf.math.bincount correctly raises an error in eager mode when the input contains negative values. However, when the same computation is compiled with tf.function(jit_compile=True), the XLA-compiled function silently returns an empty tensor instead of raising an error.
This is an eager/XLA legality mismatch. The compiled path appears to skip or mishandle the input validation for negative values.
Activity
google-ml-butler commentedon Jul 27, 2026
Are you satisfied with the resolution of your issue?
Yes
No