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.experimental.numpy.geomspace does not return exact endpoints; integer dtype gives [1, 9, 99, 999] #129236
tnp.geomspace computes the samples as 10 ** linspace(log10(start), log10(stop)) (np_math_ops.py#L1490), so rounding error leaves the endpoints off (999.999999999999 instead of 1000.0). NumPy explicitly sets result[0] = start and result[-1] = stop (when endpoint=True) to avoid this.
With an integer dtype the error turns into wrong values, because the final cast truncates: tnp.geomspace(1, 1000, 4, dtype=np.int32) returns [1, 9, 99, 999] where NumPy returns [1, 10, 100, 1000].
Expected: endpoints exactly equal to start/stop, and integer output matching NumPy.
Hi @bodapatisaikrishna,
Thanks for reporting this issue and submitting a fix for TensorFlow. Once the PR is merged, the issue will be resolved. We appreciate your contribution.
Activity
Kayyuri commentedon Oct 19, 2026
Hi @bodapatisaikrishna,
Thanks for reporting this issue and submitting a fix for TensorFlow. Once the PR is merged, the issue will be resolved. We appreciate your contribution.
Fix several NumPy mismatches in tf.experimental.numpy
google-ml-butler commentedon Oct 23, 2026
Are you satisfied with the resolution of your issue?
Yes
No