code: def factored_joint_mvn(distributions):
      """Combine MultivariateNormals into a factored joint distribution.
  
       Given a list of multivariate normal distributions
       `dist[i] = Normal(loc[i], scale[i])`, construct the joint
       distribution given by concatenating independent samples from these
       distributions. This is multivariate normal with mean vector given by the
       concatenation of the component mean vectors, and block-diagonal covariance
       matrix in which the blocks are the component covariances.
  
       Note that for computational efficiency, multivariate normals are represented
       by a 'scale' (factored covariance) linear operator rather than the full
       covariance matrix.
  
      Args:
        distributions: Python `iterable` of MultivariateNormal distribution
          instances (e.g., `tfd.MultivariateNormalDiag`,
          `tfd.MultivariateNormalTriL`, etc.). These must be broadcastable to a
          consistent batch shape, but may have different event shapes
          (i.e., defined over spaces of different dimension).
  
      Returns:
        joint_distribution: An instance of `tfd.MultivariateNormalLinearOperator`
          representing the joint distribution constructed by concatenating
          an independent sample from each input distributions.
      """
  
      with tf.name_scope("factored_joint_mvn"):
          # We explicitly broadcast the `locs` so that we can concatenate them.
          # We don't have direct numerical access to the `scales`, which are arbitrary
          # linear operators, but `LinearOperatorBlockDiag` appears to do the right
          # thing without further intervention.
          dtype = tf.debugging.assert_same_float_dtype(distributions)
          broadcast_ones = tf.ones(
              broadcast_batch_shape(distributions), dtype=dtype
          )[..., tf.newaxis]
          return mvn_linear_operator.MultivariateNormalLinearOperator(
              loc=tf.concat(
                  [
                      mvn.mean() * broadcast_ones
                      for mvn in distributions
                  ],
                  axis=-1,
              ),
              scale=tfl.LinearOperatorBlockDiag(
                  [mvn.scale for mvn in distributions], is_square=True
              ),
          )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.sts.internal import missing_values_util
label_desc: Use image node_id 4 for calling a global function with example usage: factored_joint_mvn(distributions) and returns: mvn_linear_operator