class_docstr: Tests the correctness of the Y = JointMap({nested}) transformation.
code: def testLDJRatio(self):
      q = joint_map.JointMap(
          {"a": exp.Exp(), "b": scale.Scale(2.0), "c": shift.Shift(3.0)}
      )
      p = joint_map.JointMap(
          {"a": exp.Exp(), "b": scale.Scale(3.0), "c": shift.Shift(4.0)}
      )
  
      a = np.asarray(
          [[[1, 2], [2, 3]]], dtype=np.float32
      )  # shape=[1, 2, 2]
      b = np.asarray([[0, 4]], dtype=np.float32)  # shape=[1, 2]
      c = np.asarray([[5, 6]], dtype=np.float32)  # shape=[1, 2]
  
      x = {"a": a, "b": b, "c": c}
      y = {"a": a + 1, "b": b + 1, "c": c + 1}
      event_ndims = {"a": 1, "b": 0, "c": 0}
  
      fldj_ratio_true = p.forward_log_det_jacobian(
          x, event_ndims
      ) - q.forward_log_det_jacobian(y, event_ndims)
      fldj_ratio = ldj_ratio.forward_log_det_jacobian_ratio(
          p, x, q, y, event_ndims
      )
      self.assertAllClose(fldj_ratio_true, fldj_ratio)
  
      ildj_ratio_true = p.inverse_log_det_jacobian(
          x, event_ndims
      ) - q.inverse_log_det_jacobian(y, event_ndims)
      ildj_ratio = ldj_ratio.inverse_log_det_jacobian_ratio(
          p, x, q, y, event_ndims
      )
      self.assertAllClose(ildj_ratio_true, ildj_ratio)
  
      event_ndims = {"a": 1, "b": 2, "c": 0}
  
      fldj_ratio_true = p.forward_log_det_jacobian(
          x, event_ndims
      ) - q.forward_log_det_jacobian(y, event_ndims)
      fldj_ratio = ldj_ratio.forward_log_det_jacobian_ratio(
          p, x, q, y, event_ndims
      )
      self.assertAllClose(fldj_ratio_true, fldj_ratio)
  
      ildj_ratio_true = p.inverse_log_det_jacobian(
          x, event_ndims
      ) - q.inverse_log_det_jacobian(y, event_ndims)
      ildj_ratio = ldj_ratio.inverse_log_det_jacobian_ratio(
          p, x, q, y, event_ndims
      )
      self.assertAllClose(ildj_ratio_true, ildj_ratio)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import joint_map
  from tensorflow_probability.python.bijectors import ldj_ratio
  from tensorflow_probability.python.bijectors import reshape
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 9 for calling the JointMapBijectorTest obj's underlying member method code with example usage: obj.testLDJRatio() without return types