code: def test_corr_cholesky_transform(x_shape, mapping):
      transform = mapping(constraints.corr_cholesky)
      x = torch.randn(x_shape, requires_grad=True).clamp(-2, 2)
      y = transform(x)
  
      # test codomain
      assert (transform.codomain.check(y) == 1).all()
  
      # test inv
      z = transform.inv(y)
      assert_tensors_equal(x, z, prec=1e-4)
  
      # test domain
      assert (transform.domain.check(z) == 1).all()
  
      # test log_abs_det_jacobian
      log_det = transform.log_abs_det_jacobian(x, y)
      assert log_det.shape == x_shape[:-1]
  
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 4 for calling a global function with example usage: test_corr_cholesky_transform(x_shape, mapping) without return types