code: def testHalfCauchyCdfGradientZeroOutsideSupport(self):
      loc_ = [-3.1, -2.0, 0.0, 1.1]
      loc = self._create_placeholder_with_default(loc_, name="loc")
      scale = self._create_placeholder_with_default(2.0, name="scale")
      x = loc - 0.1
      _, grads = self.evaluate(
          gradient.value_and_gradient(
              lambda loc, scale, x: half_cauchy.HalfCauchy(
                  loc, scale
              ).cdf(x),
              [loc, scale, x],
          )
      )
      self.assertAllClose(
          grads, [np.zeros_like(loc_), 0.0, np.zeros_like(loc_)]
      )
  
      _, grads = self.evaluate(
          gradient.value_and_gradient(
              lambda loc, scale, x: half_cauchy.HalfCauchy(
                  loc, scale
              ).log_cdf(x),
              [loc, scale, x],
          )
      )
      self.assertAllClose(
          grads, [np.zeros_like(loc_), 0.0, np.zeros_like(loc_)]
      )
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_cauchy
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 25 for calling the _HalfCauchyTest obj's underlying member method code with example usage: obj.testHalfCauchyCdfGradientZeroOutsideSupport() without return types