code: def _test_grad_finite(self, dtype):
      x = constant_op.constant([-100.0, 0.0, 100.0], dtype=dtype)
      output = sm.log_ndtr(x) if self._use_log else sm.ndtr(x)
      fn = sm.log_ndtr if self._use_log else sm.ndtr
      # Not having the lambda sanitizer means we'd get an `IndexError` whenever
      # the user supplied function has default args.
      output, grad_output = _value_and_gradient(
          lambda x_: fn(x_), x
      )  # pylint: disable=unnecessary-lambda
      # 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 importlib
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops.distributions import special_math
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
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