tf.math.is_nan

Returns which elements of x are NaN.

tf.math.is_nan(
    x, name=None
)

Example:

x = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])
tf.math.is_nan(x) ==> [False, True, False, True, False]

Args:

Returns:

A Tensor of type bool.

Numpy Compatibility

Equivalent to np.isnan