code: def testHorseshoeLogPDFWithQuadrature(self):
      scale_np = np.array([0.5, 0.8, 1.0, 2.0, 3.0])
      scale = self._test_param(scale_np)
      dist = horseshoe.Horseshoe(scale=scale, validate_args=True)
      x = np.linspace(0.1, 10.1, 11)
      dist_log_pdf = self.evaluate(
          dist.log_prob(self._test_param(x.reshape((-1, 1))))
      )
  
      # Now use quadrature to estimate the log_prob. This is
      def log_prob_at_x(x, global_shrinkage):
          def integrand(z):
              return np.exp(
                  scipy.stats.halfcauchy.logpdf(z, loc=0, scale=1)
                  + scipy.stats.norm.logpdf(
                      x, loc=0, scale=global_shrinkage * z
                  )
              )
  
          return scipy.integrate.quad(integrand, 0.0, np.inf)[0]
  
      log_probs_quad = []
      for p in x:
          log_probs_quad.append([])
          for s in scale_np:
              log_probs_quad[-1].append(log_prob_at_x(p, s))
      log_probs_quad = np.log(log_probs_quad)
      self.assertAllClose(log_probs_quad, dist_log_pdf, atol=0.01)
  
imports: import numpy
  import scipy.stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import horseshoe
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 11 for calling the _HorseshoeTest obj's underlying member method code with example usage: obj.testHorseshoeLogPDFWithQuadrature() and returns: scipy, np