code: def test_recip_scale_exp(self):
      p = reciprocal.Reciprocal()(scale.Scale(3.0)(exp.Exp()))
      stream = test_util.test_seed_stream()
      dim = 2
      x = self.evaluate(tf.random.uniform([4, dim], seed=stream()))
      q = reciprocal.Reciprocal()(scale.Scale(2.0)(exp.Exp()))
      y = self.evaluate(tf.random.uniform([4, dim], seed=stream()))
      expected_fldjr = (
          (x - y)
          + (np.log(3) - np.log(2))  # Exp.fldj
          + -2  # Scale.fldj
          * (
              np.log(3.0 * np.exp(x) / (2 * np.exp(y)))
          )  # Reciprocal.fldj
      ).sum(-1)
      self.assertAllClose(
          expected_fldjr,
          ldj_ratio.forward_log_det_jacobian_ratio(
              p, x, q, y, event_ndims=1
          ),
      )
      self.assertAllClose(
          expected_fldjr,
          p.forward_log_det_jacobian(x, 1)
          - q.forward_log_det_jacobian(y, 1),
      )
      self.assertAllClose(
          p.inverse_log_det_jacobian(x, 1)
          - q.inverse_log_det_jacobian(y, 1),
          ldj_ratio.inverse_log_det_jacobian_ratio(
              p, x, q, y, event_ndims=1
          ),
      )
  
file_path: probability/tensorflow_probability/python/bijectors/ldj_ratio_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import ldj_ratio
  from tensorflow_probability.python.bijectors import reciprocal
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import scale_matvec_diag
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 5 for calling the LdjRatioTest obj's underlying member method code with example usage: obj.test_recip_scale_exp() without return types