code: def matrix_and_gaussian_to_gaussian(
      matrix: torch.Tensor, y_gaussian: Gaussian
  ) -> Gaussian:
      """
      Constructs a conditional Gaussian for ``p(y|x)`` where
      ``y - x @ matrix ~ y_gaussian``.
  
      :param torch.Tensor matrix: A right-acting transformation matrix.
      :param Gaussian y_gaussian: A distribution over noise of ``y - x@matrix``.
      :rtype: Gaussian
      """
      P_yy = y_gaussian.precision
      neg_P_xy = matmul(matrix, P_yy)
      P_xy = -neg_P_xy
      P_yx = P_xy.transpose(-1, -2)
      P_xx = matmul(neg_P_xy, matrix.transpose(-1, -2))
      precision = torch.cat(
          [torch.cat([P_xx, P_xy], -1), torch.cat([P_yx, P_yy], -1)], -2
      )
      info_y = y_gaussian.info_vec
      info_x = -matvecmul(matrix, info_y)
      info_vec = torch.cat([info_x, info_y], -1)
      log_normalizer = y_gaussian.log_normalizer
  
      result = Gaussian(log_normalizer, info_vec, precision)
      return result
  
imports: import math
  from typing import Optional, Tuple, Union
  import torch
  from torch.distributions.utils import lazy_property
  from torch.nn.functional import pad
  from pyro.distributions.util import broadcast_shape
  from pyro.ops.tensor_utils import matmul, matvecmul, safe_cholesky, triangular_solve
label_desc: Use image node_id 2 for calling a global function with example usage: matrix_and_gaussian_to_gaussian(matrix, y_gaussian) and returns: result