code: def _autograd_log_det(ys, x):
      # computes log_abs_det_jacobian of y w.r.t. x
      return (
          torch.stack(
              [
                  torch.autograd.grad(y, (x,), retain_graph=True)[0]
                  for y in ys
              ]
          )
          .det()
          .abs()
          .log()
      )
  
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 2 for calling a global function with example usage: _autograd_log_det(ys, x) and returns: torch