tf.keras.ops.isreal

Test element-wise for real numbers.

x Input tensor.

Output boolean tensor.

Example:

from keras import ops
x = ops.array([1+1j, 1+0j, 4.5, 3, 2, 2j], dtype="complex64")
ops.isreal(x)
array([False,  True,  True,  True,  True, False])