code: def testHalfCauchySampleMultidimensionalMedian(self):
      batch_size = 2
      loc_ = [3.0, -3.0]
      scale_ = [0.5, 1.0]
      loc = self._create_placeholder_with_default(
          [loc_] * batch_size, name="loc"
      )
      scale = self._create_placeholder_with_default(
          [scale_] * batch_size, name="scale"
      )
      n_ = [int(1e5), 2]
      n = tf.convert_to_tensor(n_, dtype=tf.int32, name="n")
      dist = half_cauchy.HalfCauchy(
          loc=loc, scale=scale, validate_args=True
      )
      samples = dist.sample(n, seed=test_util.test_seed())
      sample_values = self.evaluate(samples)
  
      self.assertAllEqual(sample_values.shape, n_ + [batch_size, 2])
      self.assertAllClose(
          np.median(sample_values[:, :, 0, 0]),
          stats.halfcauchy.median(loc_[0], scale_[0]),
          atol=1e-1,
      )
      self.assertAllClose(
          np.median(sample_values[:, :, 0, 1]),
          stats.halfcauchy.median(loc_[1], scale_[1]),
          atol=1e-1,
      )
  
      expected_shape = tf.TensorShape(n_).concatenate(
          tf.TensorShape(self.evaluate(dist.batch_shape_tensor()))
      )
      self.assertAllEqual(expected_shape, sample_values.shape)
  
      expected_shape = tf.TensorShape(n_).concatenate(dist.batch_shape)
      self.assertAllEqual(expected_shape, samples.shape)
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_cauchy
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 23 for calling the _HalfCauchyTest obj's underlying member method code with example usage: obj.testHalfCauchySampleMultidimensionalMedian() without return types