code: def testFiniteGradients(self, dtype):
      scale = tf.constant(dtype(3.0))
      x = np.array([0.01, 0.1, 1.0, 5.0, 10.0]).astype(dtype)
  
      def half_normal_function(name, x):
          def _half_normal(scale):
              return getattr(
                  half_normal.HalfNormal(
                      scale=scale, validate_args=True
                  ),
                  name,
              )(x)
  
          return _half_normal
  
      for func_name in [
          "cdf",
          "log_cdf",
          "survival_function",
          "log_prob",
          "prob",
          "log_survival_function",
      ]:
          print(func_name)
          value, grads = self.evaluate(
              gradient.value_and_gradient(
                  half_normal_function(func_name, x), scale
              )
          )
          self.assertAllFinite(value)
          self.assertAllFinite(grads)
  
imports: from absl.testing import parameterized
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_normal
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 14 for calling the HalfNormalTest obj's underlying member method code with example usage: obj.testFiniteGradients(dtype) and returns: _half_normal, getattr