code: def testPDFAndLogPDF(self):
      batch_size = 6
      df_v = 3.0
      loc_v = -7.0
      sigma_v = 8.0
      df = tf.constant([df_v] * batch_size)
      loc = tf.constant([loc_v] * batch_size)
      sigma = tf.constant([sigma_v] * batch_size)
      t = np.array([-2.5, 2.5, 8.0, 0.0, -1.0, 2.0], dtype=np.float32)
      half_student = half_student_t.HalfStudentT(
          df, loc=loc, scale=sigma, validate_args=True
      )
  
      log_pdf = half_student.log_prob(t)
      self.assertEqual(log_pdf.shape, (batch_size,))
      log_pdf_values = self.evaluate(log_pdf)
      pdf = half_student.prob(t)
      self.assertEqual(pdf.shape, (batch_size,))
      pdf_values = self.evaluate(pdf)
  
      expected_log_pdf = np.log(2.0) + sp_stats.t.logpdf(
          t, df_v, loc=loc_v, scale=sigma_v
      )
      expected_pdf = 2.0 * sp_stats.t.pdf(
          t, df_v, loc=loc_v, scale=sigma_v
      )
      self.assertAllClose(expected_log_pdf, log_pdf_values)
      self.assertAllClose(np.log(expected_pdf), log_pdf_values)
      self.assertAllClose(expected_pdf, pdf_values)
      self.assertAllClose(np.exp(expected_log_pdf), pdf_values)
  
imports: import math
  import numpy
  from scipy import stats
  from scipy.special import gamma
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_student_t
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 1 for calling the HalfStudentTTest obj's underlying member method code with example usage: obj.testPDFAndLogPDF() without return types