code: def _test_grad_finite(self, dtype):
      x = tf.constant([-100.0, 0.0, 100.0], dtype=dtype)
      fn = special_math.log_ndtr if self._use_log else special_math.ndtr
      # Not having the lambda sanitzer means we'd get an `IndexError` whenever
      # the user supplied function has default args.
      output, grad_output = value_and_gradient(fn, x)
      # isfinite checks for NaN and Inf.
      output_, grad_output_ = self.evaluate([output, grad_output])
      self.assert_all_true(np.isfinite(output_))
      self.assert_all_true(np.isfinite(grad_output_[0]))
  
imports: import collections
  import numpy
  from scipy import special
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import special_math
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
label_desc: Use image node_id 3 for calling the NdtrGradientTest obj's underlying member method code with example usage: obj._test_grad_finite(dtype) without return types