is_nan

dragon.vm.tensorflow.math.is_nan(
  x,
  name=None
)[source]

Check if the elements of input are NaN.

\[\text{out} = \text{isnan}(x) \]

Examples:

x = tf.constant([0., 1., float('nan')])
print(tf.math.is_nan(x))  # [False, False, True]
Parameters:
  • x (dragon.Tensor) – The input tensor.
  • name (str, optional) – A optional name for the operation.
Returns:

dragon.Tensor – The output tensor.