code: def test_sample_batch():
      # Regression test for https://github.com/pyro-ppl/pyro/issues/2615
      dist = LKJCholesky(3, concentration=torch.ones(())).expand([12])
      # batch shape and event shape are as you'd expect
      assert dist.batch_shape == torch.Size([12])
      assert dist.event_shape == torch.Size([3, 3])
      # samples have correct shape when sample_shape=()
      assert dist.shape(()) == torch.Size([12, 3, 3])
      assert dist.sample().shape == torch.Size([12, 3, 3])
      # samples had the wrong shape when sample_shape is non-unit
      assert dist.shape((4,)) == torch.Size([4, 12, 3, 3])
      assert dist.sample((4,)).shape == torch.Size([4, 12, 3, 3])
  
file_path: pyro/tests/distributions/test_lkj.py
imports: import math
  import pytest
  import torch
  from torch.distributions import AffineTransform, Beta, TransformedDistribution, biject_to, transform_to
  from pyro.distributions import constraints, transforms
  from pyro.distributions.torch import LKJCholesky
  from tests.common import assert_equal, assert_tensors_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_sample_batch() without return types