code: def _bad_nan(val):
      # If the value is +-inf, nan in the derivative doesn't matter because we
      # always know what to do.
      bad_nan_df = tf.math.is_finite(val.f) & tf.math.is_nan(val.df)
      return tf.math.is_nan(val.f) | bad_nan_df
  
file_path: probability/tensorflow_probability/python/optimizer/linesearch/internal/hager_zhang_lib.py
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 13 for calling a global function with example usage: _bad_nan(val) and returns: unknown