code: def expand_independent_outputs(
      fvar: tf.Tensor, full_cov: bool, full_output_cov: bool
  ) -> tf.Tensor:
      """
      Reshapes fvar to the correct shape, specified by `full_cov` and `full_output_cov`.
  
      :param fvar: Single-output covariance.
      :return: Multi-output covariance.
      """
      if full_cov and full_output_cov:
          fvar = tf.linalg.diag(tf.transpose(fvar))  # [N, N, P, P]
          fvar = tf.transpose(fvar, [0, 2, 1, 3])  # [N, P, N, P]
      if not full_cov and full_output_cov:
          fvar = tf.linalg.diag(fvar)  # [N, P, P]
      if full_cov and not full_output_cov:
          pass  # [P, N, N]
      if not full_cov and not full_output_cov:
          pass  # [N, P]
  
      return fvar
  
file_path: GPflow/gpflow/conditionals/util.py
imports: from typing import Optional, Tuple
  import tensorflow
  from check_shapes import check_shape
  from check_shapes import check_shapes
  from ..base import MeanAndVariance
  from ..config import default_float, default_jitter
  from ..utilities.ops import leading_transpose
label_desc: Use image node_id 4 for calling a global function with example usage: expand_independent_outputs(fvar, full_cov, full_output_cov) and returns: fvar