code: def testTheoreticalFldj(self):
      raw_mat = tf.constant([[1.0, 2, 3], [4, 5, 6], [0.5, 0.0, 0.25]])
      nbatch = 5
      batch_mats = (
          raw_mat
          * tf.range(1.0, nbatch + 1.0)[:, tf.newaxis, tf.newaxis]
      )
      lower_upper, permutation = tf.linalg.lu(
          tf.cast(batch_mats, tf.float64)
      )
  
      bijector = scale_matvec_lu.ScaleMatvecLU(
          lower_upper=lower_upper,
          permutation=permutation,
          validate_args=True,
      )
      self.assertEqual(tf.float64, bijector.dtype)
  
      channels = tf.compat.dimension_value(lower_upper.shape[-1])
      x = np.random.uniform(size=[2, 7, nbatch, channels]).astype(
          np.float64
      )
      y = self.evaluate(bijector.forward(x))
      bijector_test_util.assert_bijective_and_finite(
          bijector,
          x,
          y,
          eval_func=self.evaluate,
          event_ndims=1,
          inverse_event_ndims=1,
          rtol=1e-5,
      )
      fldj = bijector.forward_log_det_jacobian(x, event_ndims=1)
      # The jacobian is not yet broadcast, since it is constant.
      fldj = fldj + tf.zeros(tf.shape(x)[:-1], dtype=x.dtype)
      fldj_theoretical = bijector_test_util.get_fldj_theoretical(
          bijector, x, event_ndims=1
      )
      self.assertAllClose(
          self.evaluate(fldj_theoretical),
          self.evaluate(fldj),
          atol=1e-5,
          rtol=1e-5,
      )
  
file_path: probability/tensorflow_probability/python/bijectors/scale_matvec_lu_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import scale_matvec_lu
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 4 for calling the ScaleMatvecLUTest obj's underlying member method code with example usage: obj.testTheoreticalFldj() without return types