class_docstr: Tests the correctness of the Y = Chain(bij1, bij2, bij3) transformation.
code: def testChainDynamicToStatic(self):
      if tf.executing_eagerly():
          return
  
      def xform_dynamic(x):
          return tf1.placeholder_with_default(x, shape=None)
  
      def xform_static(x):
          # Copy the Tensor, because otherwise the set_shape can pass information
          # into the past.
          x = tf.identity(x)
          tensorshape_util.set_shape(x, [1])
          return x
  
      def ldj(_):
          return tf.constant(1.0)
  
      # The issue was that the sample's shape was going in-and-out of being fully
      # specified, causing internal consistency issues inside the bijector.
      bijector = chain.Chain(
          [
              inline.Inline(
                  inverse_fn=xform_dynamic,
                  forward_min_event_ndims=0,
                  forward_log_det_jacobian_fn=ldj,
                  forward_fn=xform_dynamic,
              ),
              inline.Inline(
                  inverse_fn=xform_static,
                  forward_min_event_ndims=0,
                  forward_log_det_jacobian_fn=ldj,
                  forward_fn=xform_static,
              ),
              inline.Inline(
                  inverse_fn=xform_dynamic,
                  forward_min_event_ndims=0,
                  forward_log_det_jacobian_fn=ldj,
                  forward_fn=xform_dynamic,
              ),
          ]
      )
  
      ildj = bijector.inverse_log_det_jacobian(
          tf.zeros((2, 3), dtype=tf.float32), event_ndims=1
      )
  
      # The shape of `ildj` is known statically to be scalar; its value is
      # not statically known.
      self.assertTrue(tensorshape_util.is_fully_defined(ildj.shape))
  
      # `ldj_reduce_shape` uses `prefer_static` to get input shapes. That means
      # that we respect statically-known shape information where present.
      # In this case, the manually-assigned static shape is incorrect.
      self.assertEqual(self.evaluate(ildj), -7.0)
  
      # Ditto.
      fldj = bijector.forward_log_det_jacobian([0.0], event_ndims=0)
      self.assertTrue(tensorshape_util.is_fully_defined(fldj.shape))
      self.assertEqual(self.evaluate(fldj), 3.0)
  
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 17 for calling the ChainBijectorTest obj's underlying member method code with example usage: obj.testChainDynamicToStatic() and returns: tf1, x, tf