code: def test_bvm_multidim():
      vm = VonMises(tensor(0.0), tensor(1.0))
      hn = HalfNormal(tensor(1.0))
      b = Beta(tensor(2.0), tensor(2.0))
      g = Geometric(torch.tensor([0.4, 0.2, 0.5]))
      for _ in range(25):
          while True:
              batch_dim = tuple(int(i) for i in g.sample() if i > 0)
              sample_dim = tuple(int(i) for i in g.sample() if i > 0)
              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(bmv.batch_shape, torch.Size(batch_dim))
          assert_equal(
              bmv.sample(sample_dim).shape,
              torch.Size((*sample_dim, *batch_dim, 2)),
          )
  
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 4 for calling a global function with example usage: test_bvm_multidim() without return types