[XLA] Complex log1p(-1+0j) returns zero instead of -Inf on CPU and GPU

Offen
#128,983 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@Venkat6871 arbeitet bereits daran.

Seit 12.10.2026.

  • #233043 von @ahlag — ohne Merge geschlossen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

2.21.0 comp:xla type:bug
Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

TensorFlow: 2.23.0-dev20261011

Custom code

Yes

OS platform and distribution

Ubuntu24.04

Mobile device

No response

Python version

3.11.15

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

12.0.140

GPU model and memory

No response

Current behavior?

When compiling tf.math.log1p with XLA, the complex input -1+0j incorrectly produces 0+0j instead of a result with real part -Inf.

The issue reproduces on both CPU and GPU. Eager execution and non-XLA tf.function correctly preserve the logarithmic singularity.

Standalone code to reproduce the issue
import numpy as np
import tensorflow as tf

@tf.function(jit_compile=True)
def compiled(x):
    return tf.math.log1p(x)

x = tf.constant([-1 + 0j], dtype=tf.complex64)

eager = tf.math.log1p(x).numpy()
xla = compiled(x).numpy()

print("eager:", eager)
print("XLA:", xla)
Relevant log output
eager: [-inf+nanj]
XLA: [0.+0.j]
Vorherrschende Sprache
C++
Sterne
202k
Forks
78k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
460

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus tensorflow/tensorflow

Alle Issues in tensorflow/tensorflow

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.