code: def testPosteriorMarginal(self):
      bm = mixture_same_family.MixtureSameFamily(
          mixture_distribution=categorical.Categorical(
              probs=self._build_tensor([0.1, 0.9])
          ),
          components_distribution=categorical.Categorical(
              probs=self._build_tensor(
                  [[0.2, 0.3, 0.5], [0.7, 0.2, 0.1]]
              )
          ),
          validate_args=True,
      )
      marginal_dist = bm.posterior_marginal(
          self._build_tensor([0.0, 1.0, 2.0])
      )
      marginals = self.evaluate(marginal_dist.probs_parameter())
  
      self.assertAllEqual([3, 2], self._shape(marginals))
  
      expected_marginals = [
          [
              (0.1 * 0.2) / (0.1 * 0.2 + 0.9 * 0.7),
              (0.9 * 0.7) / (0.1 * 0.2 + 0.9 * 0.7),
          ],
          [
              (0.1 * 0.3) / (0.1 * 0.3 + 0.9 * 0.2),
              (0.9 * 0.2) / (0.1 * 0.3 + 0.9 * 0.2),
          ],
          [
              (0.1 * 0.5) / (0.1 * 0.5 + 0.9 * 0.1),
              (0.9 * 0.1) / (0.1 * 0.5 + 0.9 * 0.1),
          ],
      ]
  
      self.assertAllClose(marginals, expected_marginals)
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import dirichlet
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import logistic
  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.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 11 for calling the _MixtureSameFamilyTest obj's underlying member method code with example usage: obj.testPosteriorMarginal() without return types