code: def test_matrix_and_mvn_to_gaussian_2(
      sample_shape, batch_shape, x_dim, y_dim
  ):
      matrix = torch.randn(batch_shape + (x_dim, y_dim))
      y_mvn = random_mvn(batch_shape, y_dim)
      x_mvn = random_mvn(batch_shape, x_dim)
      Mx_cov = (
          matrix.transpose(-2, -1)
          .matmul(x_mvn.covariance_matrix)
          .matmul(matrix)
      )
      Mx_loc = (
          matrix.transpose(-2, -1)
          .matmul(x_mvn.loc.unsqueeze(-1))
          .squeeze(-1)
      )
      mvn = dist.MultivariateNormal(
          Mx_loc + y_mvn.loc, Mx_cov + y_mvn.covariance_matrix
      )
      expected = mvn_to_gaussian(mvn)
  
      actual = gaussian_tensordot(
          mvn_to_gaussian(x_mvn),
          matrix_and_mvn_to_gaussian(matrix, y_mvn),
          dims=x_dim,
      )
      assert_close_gaussian(expected, actual)
  
imports: import math
  from collections import OrderedDict
  import pytest
  import torch
  from torch.distributions import constraints, transform_to
  from torch.nn.functional import pad
  import pyro.distributions
  from pyro.distributions.util import broadcast_shape
  from pyro.ops.gaussian import AffineNormal, Gaussian, gaussian_tensordot, matrix_and_gaussian_to_gaussian, matrix_and_mvn_to_gaussian, mvn_to_gaussian, sequential_gaussian_filter_sample, sequential_gaussian_tensordot
  from tests.common import assert_close
  from tests.ops.gaussian import assert_close_gaussian, random_gaussian, random_mvn
label_desc: Use image node_id 16 for calling a global function with example usage: test_matrix_and_mvn_to_gaussian_2(sample_shape, batch_shape, x_dim, y_dim) without return types