class_docstr: Marginal distribution of a Multitask GP at finitely many points.
code: def _get_flattened_marginal_distribution(self, index_points=None):
      # This returns a MVN of event size [N * E], where N is the number of tasks
      # and E is the number of index points.
      with self._name_and_control_scope(
          "get_flattened_marginal_distribution"
      ):
          index_points = self._get_index_points(index_points)
          scale = _compute_flattened_scale(
              kernel=self.kernel,
              index_points=index_points,
              cholesky_fn=self._cholesky_fn,
              observation_noise_variance=self.observation_noise_variance,
          )
  
          batch_shape = self._batch_shape_tensor(
              index_points=index_points
          )
          event_shape = self._event_shape_tensor(
              index_points=index_points
          )
  
          loc = self._mean_fn(index_points)
          # Ensure that we broadcast the mean function result to ensure we support
          # constant mean functions (constant over all tasks, and a constant
          # per-task)
          loc = ps.broadcast_to(
              loc, ps.concat([batch_shape, event_shape], axis=0)
          )
          loc = _vec(loc)
          return mvn_linear_operator.MultivariateNormalLinearOperator(
              loc=loc,
              scale=scale,
              validate_args=self._validate_args,
              allow_nan_stats=self._allow_nan_stats,
              name="marginal_distribution",
          )
  
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import cholesky_util
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.distributions.internal import stochastic_process_util
  from tensorflow_probability.python.experimental.linalg import linear_operator_unitary
  from tensorflow_probability.python.experimental.psd_kernels import multitask_kernel
  from tensorflow_probability.python.internal import batch_shape_lib
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 12 for calling the MultiTaskGaussianProcess obj's underlying member method code with example usage: obj._get_flattened_marginal_distribution(index_points) and returns: mvn_linear_operator