class_docstr: Tests the correctness of the Y = Chain(bij1, bij2, bij3) transformation.
code: def testEventNdimsIsOptional(self):
      scale_diag = np.array([1.0, 2.0, 3.0], dtype=np.float32)
      bijector = chain.Chain(
          [
              scale_matvec_diag.ScaleMatvecDiag(scale_diag=scale_diag),
              exp.Exp(),
          ]
      )
      x = [
          0.0,
          np.log(2.0, dtype=np.float32),
          np.log(3.0, dtype=np.float32),
      ]
      y = [1.0, 4.0, 9.0]
      self.assertAllClose(
          np.log(6, dtype=np.float32) + np.sum(x),
          self.evaluate(bijector.forward_log_det_jacobian(x)),
      )
      self.assertAllClose(
          -np.log(6, dtype=np.float32) - np.sum(x),
          self.evaluate(bijector.inverse_log_det_jacobian(y)),
      )
  
imports: import mock
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import inline
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import joint_map
  from tensorflow_probability.python.bijectors import restructure
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import scale_matvec_diag
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.bijectors import split
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 15 for calling the ChainBijectorTest obj's underlying member method code with example usage: obj.testEventNdimsIsOptional() without return types