code: def testCauchyLogPDFMultidimensional(self):
      batch_size = 6
      loc = tf.constant([[3.0, -3.0]] * batch_size, dtype=tf.float32)
      scale = tf.constant(
          [
              [
                  np.sqrt(10.0, dtype=np.float32),
                  np.sqrt(15.0, dtype=np.float32),
              ]
          ]
          * batch_size
      )
      x = np.array(
          [[-2.5, 2.5, 4.0, 0.0, -1.0, 2.0]], dtype=np.float32
      ).T
      dist = cauchy.Cauchy(loc=loc, scale=scale, validate_args=True)
  
      log_pdf = dist.log_prob(x)
      log_pdf_values = self.evaluate(log_pdf)
      self.assertEqual(log_pdf.shape, (6, 2))
      self.assertAllEqual(
          self.evaluate(dist.batch_shape_tensor()), log_pdf.shape
      )
      self.assertAllEqual(
          self.evaluate(dist.batch_shape_tensor()),
          self.evaluate(log_pdf).shape,
      )
      self.assertAllEqual(dist.batch_shape, log_pdf.shape)
      self.assertAllEqual(
          dist.batch_shape, self.evaluate(log_pdf).shape
      )
  
      pdf = dist.prob(x)
      pdf_values = self.evaluate(pdf)
      self.assertEqual(pdf.shape, (6, 2))
      self.assertAllEqual(
          self.evaluate(dist.batch_shape_tensor()), pdf.shape
      )
      self.assertAllEqual(
          self.evaluate(dist.batch_shape_tensor()), pdf_values.shape
      )
      self.assertAllEqual(dist.batch_shape, pdf.shape)
      self.assertAllEqual(dist.batch_shape, pdf_values.shape)
  
      expected_log_pdf = sp_stats.cauchy(
          self.evaluate(loc), self.evaluate(scale)
      ).logpdf(x)
      self.assertAllClose(expected_log_pdf, log_pdf_values)
      self.assertAllClose(np.exp(expected_log_pdf), pdf_values)
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import cauchy
  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 8 for calling the CauchyTest obj's underlying member method code with example usage: obj.testCauchyLogPDFMultidimensional() without return types