code: def check_transform_elementwise_logp(
      self, model, vector_transform=False
  ):
      x = model.free_RVs[0]
      x_val_transf = model.rvs_to_values[x]
      transform = model.rvs_to_transforms[x]
      x_val_untransf = transform.backward(x_val_transf, *x.owner.inputs)
  
      point = model.initial_point(0)
      test_array_transf = floatX(
          np.random.randn(*point[x_val_transf.name].shape)
      )
      test_array_untransf = x_val_untransf.eval(
          {x_val_transf: test_array_transf}
      )
      log_jac_det = transform.log_jac_det(x_val_transf, *x.owner.inputs)
  
      [transform_logp] = transformed_conditional_logp(
          (x,),
          rvs_to_values={x: x_val_transf},
          rvs_to_transforms={x: transform},
      )
      [untransform_logp] = transformed_conditional_logp(
          (x,),
          rvs_to_values={x: x_val_untransf},
          rvs_to_transforms={},
      )
      if vector_transform:
          assert transform_logp.ndim == (x.ndim - 1) == log_jac_det.ndim
      else:
          assert transform_logp.ndim == x.ndim == log_jac_det.ndim
  
      transform_logp_eval = transform_logp.eval(
          {x_val_transf: test_array_transf}
      )
      untransform_logp_eval = untransform_logp.eval(
          {x_val_untransf: test_array_untransf}
      )
      log_jac_det_eval = log_jac_det.eval(
          {x_val_transf: test_array_transf}
      )
      # Summing the log_jac_det separately from the untransform_logp ensures there is no broadcasting between terms
      assert_allclose(
          transform_logp_eval.sum(),
          untransform_logp_eval.sum() + log_jac_det_eval.sum(),
          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 2 for calling the TestElementWiseLogp obj's underlying member method code with example usage: obj.check_transform_elementwise_logp(model, vector_transform) without return types