code: def _compute_summary_for_normal_samples_with_inverse_gamma_scale_prior(
      variance_inverse_gamma_prior,
      batch_shape,
      num_samples,
      num_observations_per_sample,
      sampled_fixed_scale,
      seed,
  ):
      """Computes the mean and standard deviation from num_samples.
  
      Given an inverse gamma prior on the variance of Normal distributions scale,
      this returns summary statistics of what is expected given `num_samples`
      where each sample has `num_observations_per_sample` from
      N(0, sampled_fixed_scale).
  
      Args:
        variance_inverse_gamma_prior: Prior on the variance.
        batch_shape: Shape of batches.
        num_samples: Number of samples.
        num_observations_per_sample: How many observations is in each sample.
        sampled_fixed_scale: The scale to draw observations with.
        seed: The seed to use.
  
      Returns:
        Tuple of (mean, standard error) of the variance.
      """
      sample_square_sum = tf.math.reduce_sum(
          tf.square(
              normal.Normal(0.0, sampled_fixed_scale).sample(
                  ps.concat(
                      [
                          batch_shape,
                          (num_samples, num_observations_per_sample),
                      ],
                      axis=0,
                  ),
                  seed=seed,
              )
          ),
          axis=-1,
      )
  
      posterior_concentration = (
          variance_inverse_gamma_prior.concentration
          + (num_observations_per_sample / 2.0)
      )
      posterior_scales = variance_inverse_gamma_prior.concentration + (
          sample_square_sum / 2.0
      )
      d = inverse_gamma.InverseGamma(
          posterior_concentration, posterior_scales
      )
  
      mix = mixture_same_family.MixtureSameFamily(
          categorical.Categorical(logits=tf.zeros(d.batch_shape)), d
      )
      return mix.mean(), tf.math.sqrt(
          mix.variance() / tf.cast(num_samples, dtype=tf.float32)
      )
  
imports: import math
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import square
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.sts.components.seasonal import ConstrainedSeasonalStateSpaceModel
  from tensorflow_probability.python.sts.components.seasonal import Seasonal
  from tensorflow_probability.python.sts.components.seasonal import SeasonalStateSpaceModel
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_summary_for_normal_samples_with_inverse_gamma_scale_prior(variance_inverse_gamma_prior, batch_shape, num_samples, num_observations_per_sample, sampled_fixed_scale, seed) and returns: mix,  tf