tfdbg.has_inf_or_nan(datum, tensor)

tfdbg.has_inf_or_nan(datum, tensor)

See the guide: TensorFlow Debugger > Tensor-value predicates

A predicate for whether a tensor consists of any bad numerical values.

This predicate is common enough to merit definition in this module. Bad numerical values include nans and infs. The signature of this function follows the requirement of the method DebugDumpDir.find().


  • datum: (DebugTensorDatum) Datum metadata.
  • tensor: (numpy.ndarray or None) Value of the tensor. None represents an uninitialized tensor.


(bool) True if and only if tensor consists of any nan or inf values.

Defined in tensorflow/python/debug/lib/