code: def test_interdependent_transformed_rvs(self, reversed):
      # Test that nested transformed variables, whose transformed values depend on other
      # RVs are properly replaced
      with pm.Model() as m:
          transform = pm.distributions.transforms.Interval(
              bounds_fn=lambda *inputs: (inputs[-2], inputs[-1])
          )
          x = pm.Uniform("x", lower=0, upper=1, transform=transform)
          # Operation between the variables provides a regression test for #7054
          y = pm.Uniform(
              "y", lower=0, upper=pt.exp(x), transform=transform
          )
          z = pm.Uniform("z", lower=0, upper=y, transform=transform)
          w = pm.Uniform(
              "w", lower=0, upper=pt.square(z), transform=transform
          )
  
      rvs = [x, y, z, w]
      if reversed:
          rvs = rvs[::-1]
  
      transform_values = replace_rvs_by_values(
          rvs,
          rvs_to_values=m.rvs_to_values,
          rvs_to_transforms=m.rvs_to_transforms,
      )
  
      assert_no_rvs(transform_values)
      # Test that we haven't introduced value variables in the random graph (issue #7054)
      assert not inputvars(rvs)
  
      if reversed:
          transform_values = transform_values[::-1]
      transform_values_fn = m.compile_fn(
          transform_values, point_fn=False
      )
  
      x_interval_test_value = np.random.rand()
      y_interval_test_value = np.random.rand()
      z_interval_test_value = np.random.rand()
      w_interval_test_value = np.random.rand()
  
      # The 3 Nones correspond to unused rng, dtype and size arguments
      expected_x = transform.backward(
          x_interval_test_value, None, None, None, 0, 1
      ).eval()
      expected_y = transform.backward(
          y_interval_test_value, None, None, None, 0, pt.exp(expected_x)
      ).eval()
      expected_z = transform.backward(
          z_interval_test_value, None, None, None, 0, expected_y
      ).eval()
      expected_w = transform.backward(
          w_interval_test_value,
          None,
          None,
          None,
          0,
          pt.square(expected_z),
      ).eval()
  
      np.testing.assert_allclose(
          transform_values_fn(
              x_interval__=x_interval_test_value,
              y_interval__=y_interval_test_value,
              z_interval__=z_interval_test_value,
              w_interval__=w_interval_test_value,
          ),
          [expected_x, expected_y, expected_z, expected_w],
      )
  
imports: import numpy
  import pytensor
  import pytest
  from pytensor import function
  from pytensor import tensor
  from pytensor.compile import get_default_mode
  from pytensor.graph.basic import ancestors, equal_computations
  from pytensor.tensor.random.op import RandomVariable
  import pymc
  from pymc import SymbolicRandomVariable, inputvars
  from pymc.distributions.transforms import Interval
  from pymc.logprob.abstract import MeasurableVariable
  from pymc.logprob.basic import logp
  from pymc.logprob.utils import ParameterValueError, check_potential_measurability, dirac_delta, replace_rvs_by_values
  from pymc.testing import assert_no_rvs
  from tests.logprob.utils import create_pytensor_params, scipy_logprob_tester
label_desc: Use image node_id 5 for calling the TestReplaceRVsByValues obj's underlying member method code with example usage: obj.test_interdependent_transformed_rvs(reversed) without return types