code: def testGeneralizedNormalSample(self):
      loc = tf.constant(3.0, self.dtype)
      scale = tf.constant(math.sqrt(3.0), self.dtype)
      power = tf.constant(3.0, self.dtype)
      loc_v = 3.0
      scale_v = np.sqrt(3.0 / sp_gamma(1.0 / 3.0))
      n = tf.constant(100000)
      gnormal = generalized_normal.GeneralizedNormal(
          loc=loc, scale=scale, power=power, validate_args=True
      )
      samples = gnormal.sample(n, seed=test_util.test_seed())
      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(sample_values.shape, (100000,))
      self.assertAllClose(sample_values.mean(), loc_v, atol=1e-1)
      self.assertAllClose(sample_values.std(), scale_v, atol=1e-1)
  
      expected_samples_shape = tf.TensorShape(
          [self.evaluate(n)]
      ).concatenate(
          tf.TensorShape(self.evaluate(gnormal.batch_shape_tensor()))
      )
  
      self.assertAllEqual(expected_samples_shape, samples.shape)
      self.assertAllEqual(expected_samples_shape, sample_values.shape)
  
      expected_samples_shape = tf.TensorShape(
          [self.evaluate(n)]
      ).concatenate(gnormal.batch_shape)
  
      self.assertAllEqual(expected_samples_shape, samples.shape)
      self.assertAllEqual(expected_samples_shape, sample_values.shape)
  
imports: import math
  import numpy
  from scipy import stats
  from scipy.special import gamma
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import generalized_normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 17 for calling the _GeneralizedNormalTest obj's underlying member method code with example usage: obj.testGeneralizedNormalSample() without return types