code: def test_log_prob_normalization(
      dim, df=6.1, grid_size=2000, domain_width=5.0
  ):
      scale_tril = (
          0.2 * torch.randn(dim) - 1.5
      ).exp().diag() + 0.1 * torch.randn(dim, dim)
      scale_tril = 0.1 * scale_tril.tril(0)
  
      volume_factor = domain_width
      prec = 0.01
      if dim == 2:
          volume_factor = volume_factor**2
          prec = 0.05
  
      sample_shape = (grid_size * grid_size, dim)
      z = torch.distributions.Uniform(
          -0.5 * domain_width, 0.5 * domain_width
      ).sample(sample_shape)
  
      d = MultivariateStudentT(
          torch.tensor(df), torch.zeros(dim), scale_tril
      )
      normalizer = d.log_prob(z).exp().mean().item() * volume_factor
  
      assert_equal(normalizer, 1.0, prec=prec)
  
file_path: pyro/tests/distributions/test_mvt.py
imports: import math
  import pytest
  import torch
  from torch.distributions import Gamma, MultivariateNormal, StudentT
  from pyro.distributions import MultivariateStudentT
  from tests.common import assert_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_log_prob_normalization(dim, df, grid_size, domain_width) without return types