Tensor-value predicates

Built-in tensor-filter predicates to support conditional breakpoint between runs. See DebugDumpDir.find() for more details.

tf_debug.has_inf_or_nan(datum, tensor)

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.