code: def testCDFAndLogCDF(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_cdf = half_student.log_cdf(t)
      self.assertEqual(log_cdf.shape, (6,))
      log_cdf_values = self.evaluate(log_cdf)
      cdf = half_student.cdf(t)
      self.assertEqual(cdf.shape, (6,))
      cdf_values = self.evaluate(cdf)
  
      # no reference implementation in numpy/scipy, so use
      # CDF(|X|) = 2 CDF(X) - 1, and just take the log of that
      # for the log_cdf
      expected_cdf = (
          2.0 * sp_stats.t.cdf(t, df_v, loc=loc_v, scale=sigma_v) - 1.0
      )
      expected_log_cdf = np.log(expected_cdf)
      self.assertAllClose(
          expected_log_cdf, log_cdf_values, atol=0.0, rtol=1e-5
      )
      self.assertAllClose(
          np.log(expected_cdf), log_cdf_values, atol=0.0, rtol=1e-5
      )
      self.assertAllClose(expected_cdf, cdf_values, atol=0.0, rtol=1e-5)
      self.assertAllClose(
          np.exp(expected_log_cdf), cdf_values, atol=0.0, rtol=1e-5
      )
  
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 3 for calling the HalfStudentTTest obj's underlying member method code with example usage: obj.testCDFAndLogCDF() without return types