code: def test_gaussian_hmm_log_prob(
      init_shape,
      trans_mat_shape,
      trans_mvn_shape,
      obs_mat_shape,
      obs_mvn_shape,
      hidden_dim,
      obs_dim,
  ):
      init_dist = random_mvn(init_shape, hidden_dim)
      trans_mat = torch.randn(
          trans_mat_shape + (hidden_dim, hidden_dim)
      )
      trans_dist = random_mvn(trans_mvn_shape, hidden_dim)
      obs_mat = torch.randn(obs_mat_shape + (hidden_dim, obs_dim))
      obs_dist = random_mvn(obs_mvn_shape, obs_dim)
  
      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_mat_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-4, rtol=1e-4
      )
      check_expand(actual_dist, data)
  
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 6 for calling a global function with example usage: test_gaussian_hmm_log_prob(init_shape, trans_mat_shape, trans_mvn_shape, obs_mat_shape, obs_mvn_shape, hidden_dim, obs_dim) without return types