code: def _cartesian_product(*supports):
      """Construct "cartesian product" of tensors.
  
      Args:
        *supports: a sequence of tensors `s1, ..., sn`.
  
      Returns:
        This function computes a tensor analogous to the cartesian
        product of sets.
        If `t = _cartesian_product(s1, ..., sn)` then
        `t[i1, ..., in] = s1[i1] s2[i2] ... sn[in]`
        where the elements on the right hand side are concatenated
        together.
  
        In particular, if `s1, ..., sn` are the supports of `n`
        distributions, the cartesian product represents the support of the
        product distribution.
  
        For example if `a = [0, 1]`, b = [10, 20]` and
        `c = _cartesian_product(a, b)` then
        `c = [[[0, 10], [0, 20]], [[1, 10], [1, 20]]]`.
        In this case note (for example) that
        `a[0] = 0`, `b[1] = 20` and so `c[0, 1] = [0, 20]`.
      """
  
      return tf.stack(tf.meshgrid(*supports, indexing="ij"), axis=-1)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import joint_distribution
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.experimental.marginalize.logeinsumexp import logeinsumexp
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 2 for calling a global function with example usage: _cartesian_product() and returns: tf