code: def testSampleMultiDimensional(self):
      batch_size = 7
      df_v = [5.0, 7.0]
      loc_v = [3.0, -3.0]
      sigma_v = [math.sqrt(10.0), math.sqrt(15.0)]
      df = tf.constant([df_v] * batch_size)
      loc = tf.constant([loc_v] * batch_size)
      sigma = tf.constant([sigma_v] * batch_size)
      n = tf.constant(200000)
      half_student = half_student_t.HalfStudentT(
          df=df, loc=loc, scale=sigma, validate_args=True
      )
      samples = half_student.sample(n, seed=test_util.test_seed())
      sample_values = self.evaluate(samples)
      expected_mean = self.evaluate(half_student.mean()).mean(axis=0)
      expected_var = self.evaluate(half_student.variance()).mean(axis=0)
      self.assertEqual(samples.shape, (200000, batch_size, 2))
      self.assertAllClose(
          sample_values[:, 0, 0].mean(),
          expected_mean[0],
          rtol=0.1,
          atol=0,
      )
      self.assertAllClose(
          sample_values[:, 0, 0].var(),
          expected_var[0],
          rtol=0.2,
          atol=0,
      )
      self._checkKLApprox(
          df_v[0], loc_v[0], sigma_v[0], sample_values[:, 0, 0]
      )
      self.assertAllClose(
          sample_values[:, 0, 1].mean(),
          expected_mean[1],
          rtol=0.1,
          atol=0,
      )
      self.assertAllClose(
          sample_values[:, 0, 1].var(),
          expected_var[1],
          rtol=0.2,
          atol=0,
      )
      self._checkKLApprox(
          df_v[1], loc_v[1], sigma_v[1], sample_values[:, 0, 1]
      )
  
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 8 for calling the HalfStudentTTest obj's underlying member method code with example usage: obj.testSampleMultiDimensional() without return types