code: def testTheoreticalFldj(self, data):
      if not tf.executing_eagerly():
          msg = (
              "Testing eager mode only because graph is very slow, "
              "presumably due to costly graph construction."
          )
          self.skipTest(msg)
      if JAX_MODE:  # TODO(b/160167257): Eliminate this workaround.
          # get_fldj_theoretical uses tfp.math.batch_jacobian and assumes the
          # behavior of the bijector does not vary by position. In this case, it
          # can, so we must vmap the result.
          batch_shape = [1]
      else:
          # get_fldj_theoretical test rig requires 1-d batches.
          batch_shape = data.draw(
              tfp_hps.shapes(min_ndims=1, max_ndims=1)
          )
      hp.note("batch shape: {}".format(batch_shape))
      bijector = data.draw(
          rq_splines(batch_shape=batch_shape, dtype=tf.float64)
      )
      self.assertEqual(tf.float64, bijector.dtype)
      bw, bh, kd = self.evaluate(
          [
              bijector.bin_widths,
              bijector.bin_heights,
              bijector.knot_slopes,
          ]
      )
      hp.note("bw: {!r}\nbh: {!r}\nkd: {!r}".format(bw, bh, kd))
      x_shp = ((bw + bh)[..., :-1] + kd).shape[:-1]
      if x_shp[-1] == 1:  # Possibly broadcast the x dim.
          dim = data.draw(hps.integers(min_value=1, max_value=7))
          x_shp = x_shp[:-1] + (dim,)
      x = np.linspace(
          -4.9, 4.9, np.prod(x_shp), dtype=np.float64
      ).reshape(*x_shp)
      hp.note("x: {!r}".format(x))
      y = self.evaluate(bijector.forward(x))
      hp.note("x: {!r}".format(x))
      bijector_test_util.assert_bijective_and_finite(
          bijector,
          x,
          y,
          eval_func=self.evaluate,
          event_ndims=0,
          inverse_event_ndims=0,
          rtol=1e-5,
      )
      fldj = bijector.forward_log_det_jacobian(x, event_ndims=0)
      fldj_theoretical = bijector_test_util.get_fldj_theoretical(
          bijector, x, event_ndims=0
      )
      self.assertAllClose(
          self.evaluate(fldj_theoretical),
          self.evaluate(fldj),
          atol=1e-5,
          rtol=1e-5,
      )
  
imports: import functools
  import hypothesis
  from hypothesis import strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import hypothesis_testlib
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import rational_quadratic_spline
  from tensorflow_probability.python.bijectors import real_nvp
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 4 for calling the RationalQuadraticSplineTest obj's underlying member method code with example usage: obj.testTheoreticalFldj(data) without return types