code: def test_bvm_unnorm_log_prob(batch_dim):
      vm = VonMises(tensor(0.0), tensor(1.0))
      hn = HalfNormal(tensor(1.0))
      b = Beta(tensor(2.0), tensor(2.0))
  
      while True:
          phi_psi = vm.sample((*batch_dim, 2))
          locs = vm.sample((2, *batch_dim))
          conc = hn.sample((2, *batch_dim))
          corr = b.sample((*batch_dim,))
          if torch.all(torch.prod(conc, dim=0) > corr**2):
              break
      bmv = SineBivariateVonMises(
          locs[0], locs[1], conc[0], conc[1], corr
      )
      assert_equal(
          _unnorm_log_prob(
              phi_psi, locs[0], locs[1], conc[0], conc[1], corr
          ),
          bmv.log_prob(phi_psi) + bmv.norm_const,
      )
  
file_path: pyro/tests/distributions/test_sine_bivariate_von_mises.py
imports: import pytest
  import torch
  from scipy.special import binom
  from torch import tensor
  from torch.distributions import Beta, HalfNormal, VonMises
  import pyro
  from pyro.distributions import Geometric, constraints
  from pyro.distributions.sine_bivariate_von_mises import SineBivariateVonMises
  from pyro.infer import SVI, Trace_ELBO
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_bvm_unnorm_log_prob(batch_dim) without return types