code: def testGeneralizedNormalLogPDF(self):
      batch_size = 6
      mu = tf.constant([3.0] * batch_size, dtype=self.dtype)
      sigma = tf.constant(
          [math.sqrt(10.0)] * batch_size, dtype=self.dtype
      )
      power = tf.constant([4.0] * batch_size, dtype=self.dtype)
      x = np.array([-2.5, 2.5, 4.0, 0.0, -1.0, 2.0], dtype=np.float32)
      gnormal = generalized_normal.GeneralizedNormal(
          loc=mu, scale=sigma, power=power, validate_args=True
      )
      log_pdf = gnormal.log_prob(x)
      self.assertAllEqual(
          self.evaluate(gnormal.batch_shape_tensor()), log_pdf.shape
      )
      self.assertAllEqual(
          self.evaluate(gnormal.batch_shape_tensor()),
          self.evaluate(log_pdf).shape,
      )
      self.assertAllEqual(gnormal.batch_shape, log_pdf.shape)
      self.assertAllEqual(
          gnormal.batch_shape, self.evaluate(log_pdf).shape
      )
  
      pdf = gnormal.prob(x)
      self.assertAllEqual(
          self.evaluate(gnormal.batch_shape_tensor()), pdf.shape
      )
      self.assertAllEqual(
          self.evaluate(gnormal.batch_shape_tensor()),
          self.evaluate(pdf).shape,
      )
      self.assertAllEqual(gnormal.batch_shape, pdf.shape)
      self.assertAllEqual(gnormal.batch_shape, self.evaluate(pdf).shape)
  
      expected_log_pdf = sp_stats.gennorm(
          self.evaluate(power),
          loc=self.evaluate(mu),
          scale=self.evaluate(sigma),
      ).logpdf(x)
      self.assertAllClose(expected_log_pdf, self.evaluate(log_pdf))
      self.assertAllClose(np.exp(expected_log_pdf), self.evaluate(pdf))
  
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 6 for calling the _GeneralizedNormalTest obj's underlying member method code with example usage: obj.testGeneralizedNormalLogPDF() without return types