code: def test_log_prob_d2(concentration):
      dist = LKJCholesky(2, torch.tensor([concentration]))
      test_dist = TransformedDistribution(
          Beta(concentration, concentration),
          AffineTransform(loc=-1.0, scale=2.0),
      )
  
      samples = dist.sample(torch.Size([100]))
      lp = dist.log_prob(samples)
      x = samples[..., 1, 0]
      tst = test_dist.log_prob(x)
      # LKJ prevents inf values in log_prob
      lp[tst == math.inf] = math.inf  # substitute inf for comparison
      assert_tensors_equal(lp, tst, prec=1e-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 6 for calling a global function with example usage: test_log_prob_d2(concentration) without return types