code: def test_gaussian_hmm_log_prob_null_dynamics(
      init_shape,
      trans_mat_shape,
      trans_mvn_shape,
      obs_mvn_shape,
      hidden_dim,
  ):
      obs_dim = hidden_dim
      init_dist = random_mvn(init_shape, hidden_dim)
  
      # impose null dynamics
      trans_mat = torch.zeros(
          trans_mat_shape + (hidden_dim, hidden_dim)
      )
      trans_dist = random_mvn(trans_mvn_shape, hidden_dim, diag=True)
  
      # trivial observation matrix (hidden_dim = obs_dim)
      obs_mat = torch.eye(hidden_dim)
      obs_dist = random_mvn(obs_mvn_shape, obs_dim, diag=True)
  
      actual_dist = GaussianHMM(
          init_dist, trans_mat, trans_dist, obs_mat, obs_dist
      )
      expected_dist = dist.GaussianHMM(
          init_dist, trans_mat, trans_dist, obs_mat, obs_dist
      )
      assert actual_dist.batch_shape == expected_dist.batch_shape
      assert actual_dist.event_shape == expected_dist.event_shape
  
      shape = broadcast_shape(
          init_shape + (1,),
          trans_mat_shape,
          trans_mvn_shape,
          obs_mvn_shape,
      )
      data = obs_dist.expand(shape).sample()
      assert data.shape == actual_dist.shape()
  
      actual_log_prob = actual_dist.log_prob(data)
      expected_log_prob = expected_dist.log_prob(data)
  
      assert_close(
          actual_log_prob, expected_log_prob, atol=1e-5, rtol=1e-5
      )
      check_expand(actual_dist, data)
  
      obs_cov = obs_dist.covariance_matrix.diagonal(dim1=-1, dim2=-2)
      trans_cov = trans_dist.covariance_matrix.diagonal(
          dim1=-1, dim2=-2
      )
      sum_scale = (obs_cov + trans_cov).sqrt()
      sum_loc = trans_dist.loc + obs_dist.loc
  
      analytic_log_prob = (
          dist.Normal(sum_loc, sum_scale).log_prob(data).sum(-1).sum(-1)
      )
      assert_close(analytic_log_prob, actual_log_prob, atol=1.0e-5)
  
file_path: funsor/test/pyro/test_hmm.py
imports: import pyro.distributions
  import pytest
  import torch
  from funsor.pyro.hmm import DiscreteHMM, GaussianHMM, GaussianMRF, SwitchingLinearHMM
  from funsor.testing import assert_close, random_mvn
  from funsor.util import broadcast_shape
label_desc: Use image node_id 11 for calling a global function with example usage: test_gaussian_hmm_log_prob_null_dynamics(init_shape, trans_mat_shape, trans_mvn_shape, obs_mvn_shape, hidden_dim) without return types