code: def analytical_pdf(x, temperature, logits):
      # analytical density of RelaxedOneHotCategorical
      temperature = np.reshape(temperature, (-1, 1))
      if len(x.shape) == 1:
          x = np.expand_dims(x, 0)
      k = logits.shape[-1]
      p = np.exp(logits) / np.sum(
          np.exp(logits), axis=-1, keepdims=True
      )
      term1 = gamma(k) * np.power(temperature, k - 1)
      term2 = np.sum(
          p / (np.power(x, temperature)), axis=-1, keepdims=True
      )
      term3 = np.prod(
          p / (np.power(x, temperature + 1)), axis=-1, keepdims=True
      )
      expected_pdf = term1 * np.power(term2, -k) * term3
      return expected_pdf
  
imports: from absl.testing import parameterized
  import numpy
  from scipy.special import gamma
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.distributions import relaxed_onehot_categorical
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.util import deferred_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: analytical_pdf(x, temperature, logits) and returns: expected_pdf