code: def testHorseshoeSampleMultiDimensional(self):
      batch_size = 2
      scale = self._test_param([[2.8, 3.1]] * batch_size)
      n = 100000
      dist = horseshoe.Horseshoe(scale=scale, validate_args=True)
  
      sample = dist.sample(n, seed=test_util.test_seed())
      self.assertEqual(self.evaluate(sample).shape, (n, batch_size, 2))
      template = tf.ones_like(scale)
      scale_candidates = tf.stack(
          [
              template * s
              for s in np.linspace(2.5, 3.5, 11, dtype=self.dtype)
          ],
          axis=-1,
      )
      scale_mle = self._scale_mle(sample, scale_candidates)
      self.assertAllClose(scale, self.evaluate(scale_mle), rtol=0.15)
  
      expected_shape = tf.TensorShape([n]).concatenate(
          tf.TensorShape(self.evaluate(dist.batch_shape_tensor()))
      )
      self.assertAllEqual(expected_shape, self.evaluate(sample).shape)
  
      expected_shape_static = tf.TensorShape([n]).concatenate(
          dist.batch_shape
      )
      self.assertAllEqual(expected_shape_static, sample.shape)
  
imports: import numpy
  import scipy.stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import horseshoe
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 7 for calling the _HorseshoeTest obj's underlying member method code with example usage: obj.testHorseshoeSampleMultiDimensional() without return types