-
Notifications
You must be signed in to change notification settings - Fork 74.8k
Open
Labels
2.17Issues related to 2.17 releaseIssues related to 2.17 releaseawaiting PR mergeawaiting PR mergeawaiting PR mergecomp:opsOPs related issuesOPs related issuestype:bugBugBug
Description
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
2.17
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.abs
produces inconsistent results on CPU versus GPU when the input is a complex number containing both inf
and nan
components.
Standalone code to reproduce the issue
import tensorflow as tf
import numpy as np
input_tensor = tf.constant([
complex(np.inf, np.nan)
], dtype=tf.complex128)
with tf.device('/CPU:0'):
cpu_out = tf.math.abs(input_tensor)
print(f"CPU Output: {cpu_out.numpy()}")
with tf.device('/GPU:0'):
gpu_out = tf.math.abs(input_tensor)
print(f"GPU Output: {gpu_out.numpy()}")
Relevant log output
CPU Output: [inf]
GPU Output: [nan]
Metadata
Metadata
Assignees
Labels
2.17Issues related to 2.17 releaseIssues related to 2.17 releaseawaiting PR mergeawaiting PR mergeawaiting PR mergecomp:opsOPs related issuesOPs related issuestype:bugBugBug