code: def check_jacobian_det(
      transform,
      domain,
      constructor=pt.scalar,
      test=0,
      make_comparable=None,
      elemwise=False,
      rv_var=None,
  ):
      y = constructor("y")
      y.tag.test_value = test
  
      if rv_var is None:
          rv_var = y
  
      rv_inputs = rv_var.owner.inputs if rv_var.owner else []
  
      x = transform.backward(y, *rv_inputs)
      # Assume non-injective transforms are symmetric around the origin
      if isinstance(x, tuple):
          x = x[-1]
      if make_comparable:
          x = make_comparable(x)
  
      if not elemwise:
          jac = pt.log(pt.nlinalg.det(jacobian(x, [y])))
      else:
          jac = pt.log(pt.abs(pt.diag(jacobian(x, [y]))))
  
      # ljd = log jacobian det
      actual_ljd = pytensor.function([y], jac)
  
      computed_ljd = pytensor.function(
          [y],
          pt.as_tensor_variable(transform.log_jac_det(y, *rv_inputs)),
          on_unused_input="ignore",
      )
  
      for yval in domain.vals:
          assert_allclose(
              actual_ljd(yval), computed_ljd(yval), rtol=tol
          )
  
imports: import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from pytensor.tensor.variable import TensorConstant
  import pymc
  import pymc.distributions.transforms
  from pymc.logprob.basic import transformed_conditional_logp
  from pymc.logprob.transforms import Transform
  from pymc.pytensorf import floatX, jacobian
  from pymc.testing import Circ, MultiSimplex, R, Rminusbig, Rplusbig, Simplex, SortedVector, Unit, UnitSortedVector, Vector
label_desc: Use image node_id 4 for calling a global function with example usage: check_jacobian_det(transform, domain, constructor, test, make_comparable, elemwise, rv_var) without return types