code: def test_transform_log_abs_det(batch_shape, event_shape):
      tf = OrderedTransform()
      shape = torch.Size(batch_shape + event_shape)
      x = torch.randn(shape, requires_grad=True)
      y = tf(x)
      log_det = tf.log_abs_det_jacobian(x, y)
      assert log_det.shape == batch_shape
      # The "log_abs_det_jacobian" above is more like a batch of log abs det
      # jacobians, each computed along the last (event) dimension. I'll introduce
      # the `cjald` function, defined above, to help compute this.
      log_det_actual = cjald(tf, x).det().abs().log()
      assert torch.allclose(log_det, log_det_actual)
  
file_path: pyro/tests/distributions/test_ordered_logistic.py
imports: import pytest
  import torch
  from torch.autograd.functional import jacobian
  from pyro.distributions import Normal, OrderedLogistic
  from pyro.distributions.transforms import OrderedTransform
label_desc: Use image node_id 8 for calling a global function with example usage: test_transform_log_abs_det(batch_shape, event_shape) without return types