code: def testSampleAndLogProbShapesBroadcastMix(self):
      mix_probs = self._build_tensor([0.3, 0.7])
      bern_probs = self._build_tensor([[0.4, 0.6], [0.25, 0.75]])
      bm = mixture_same_family.MixtureSameFamily(
          mixture_distribution=categorical.Categorical(probs=mix_probs),
          components_distribution=bernoulli.Bernoulli(probs=bern_probs),
          validate_args=True,
      )
      x = bm.sample([4, 5], seed=test_util.test_seed())
      log_prob_x = bm.log_prob(x)
      x_ = self.evaluate(x)
      self.assertAllEqual([4, 5, 2], self._shape(x))
      self.assertAllEqual([4, 5, 2], self._shape(log_prob_x))
      self.assertAllEqual(
          np.ones_like(x_, dtype=np.bool_),
          np.logical_or(x_ == 0.0, x_ == 1.0),
      )
  
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 3 for calling the _MixtureSameFamilyTest obj's underlying member method code with example usage: obj.testSampleAndLogProbShapesBroadcastMix() without return types