code: def test_shape(loc_shape, cov_shape, dim):
      mvn = random_mvn(loc_shape, cov_shape, dim)
      assert mvn.loc.shape == mvn.batch_shape + mvn.event_shape
      assert (
          mvn.covariance_matrix.shape
          == mvn.batch_shape + mvn.event_shape * 2
      )
      assert mvn.scale_tril.shape == mvn.covariance_matrix.shape
      assert mvn.precision_matrix.shape == mvn.covariance_matrix.shape
  
      assert_equal(
          mvn.precision_matrix, mvn.covariance_matrix.inverse()
      )
  
      # smoke test for precision/log_prob backward
      (
          mvn.precision_matrix.sum()
          + mvn.log_prob(torch.zeros(dim)).sum()
      ).backward()
  
imports: import pytest
  import torch
  from pyro.distributions import MultivariateNormal
  from tests.common import assert_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_shape(loc_shape, cov_shape, dim) without return types