code: def testNormalSampleMultiDimensional(self):
      batch_size = 2
      mu = constant_op.constant([[3.0, -3.0]] * batch_size)
      sigma = constant_op.constant(
          [[math.sqrt(2.0), math.sqrt(3.0)]] * batch_size
      )
      mu_v = [3.0, -3.0]
      sigma_v = [np.sqrt(2.0), np.sqrt(3.0)]
      n = constant_op.constant(100000)
      normal = normal_lib.Normal(loc=mu, scale=sigma)
      samples = normal.sample(n)
      sample_values = self.evaluate(samples)
      # Note that the standard error for the sample mean is ~ sigma / sqrt(n).
      # The sample variance similarly is dependent on sigma and n.
      # Thus, the tolerances below are very sensitive to number of samples
      # as well as the variances chosen.
      self.assertEqual(samples.get_shape(), (100000, batch_size, 2))
      self.assertAllClose(
          sample_values[:, 0, 0].mean(), mu_v[0], atol=1e-1
      )
      self.assertAllClose(
          sample_values[:, 0, 0].std(), sigma_v[0], atol=1e-1
      )
      self.assertAllClose(
          sample_values[:, 0, 1].mean(), mu_v[1], atol=1e-1
      )
      self.assertAllClose(
          sample_values[:, 0, 1].std(), sigma_v[1], atol=1e-1
      )
  
      expected_samples_shape = tensor_shape.TensorShape(
          [self.evaluate(n)]
      ).concatenate(
          tensor_shape.TensorShape(
              self.evaluate(normal.batch_shape_tensor())
          )
      )
      self.assertAllEqual(expected_samples_shape, samples.get_shape())
      self.assertAllEqual(expected_samples_shape, sample_values.shape)
  
      expected_samples_shape = tensor_shape.TensorShape(
          [self.evaluate(n)]
      ).concatenate(normal.batch_shape)
      self.assertAllEqual(expected_samples_shape, samples.get_shape())
      self.assertAllEqual(expected_samples_shape, sample_values.shape)
  
imports: import importlib
  import math
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.distributions import kullback_leibler
  from tensorflow.python.ops.distributions import normal
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 27 for calling the NormalTest obj's underlying member method code with example usage: obj.testNormalSampleMultiDimensional() without return types