code: def testExplicitBlocks(self, dynamic_shape, batch_shape):
      block_sizes = tf.convert_to_tensor(value=[2, 1, 3])
      block_sizes = tf1.placeholder_with_default(
          block_sizes,
          shape=(
              [None] * len(block_sizes.shape)
              if dynamic_shape
              else block_sizes.shape
          ),
      )
      e = exp.Exp()
      sp = softplus.Softplus()
      aff = scale_matvec_diag.ScaleMatvecDiag(
          scale_diag=[2.0, 3.0, 4.0]
      )
      bijector = blockwise.Blockwise(
          bijectors=[e, sp, aff],
          block_sizes=block_sizes,
          maybe_changes_size=False,
      )
  
      x = tf.cast([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype=tf.float32)
      for s in batch_shape:
          x = tf.expand_dims(x, 0)
          x = tf.tile(
              x, [s] + [1] * (tensorshape_util.rank(x.shape) - 1)
          )
      x = tf1.placeholder_with_default(
          x, shape=None if dynamic_shape else x.shape
      )
  
      # Identity to break the caching.
      blockwise_y = tf.identity(bijector.forward(x))
      blockwise_fldj = bijector.forward_log_det_jacobian(
          x, event_ndims=1
      )
      blockwise_x = bijector.inverse(blockwise_y)
      blockwise_ildj = bijector.inverse_log_det_jacobian(
          blockwise_y, event_ndims=1
      )
  
      if not dynamic_shape:
          self.assertEqual(blockwise_y.shape, batch_shape + [6])
          self.assertEqual(blockwise_fldj.shape, batch_shape + [])
          self.assertEqual(blockwise_x.shape, batch_shape + [6])
          self.assertEqual(blockwise_ildj.shape, batch_shape + [])
      self.assertAllEqual(
          self.evaluate(tf.shape(blockwise_y)), batch_shape + [6]
      )
      self.assertAllEqual(
          self.evaluate(tf.shape(blockwise_fldj)), batch_shape + []
      )
      self.assertAllEqual(
          self.evaluate(tf.shape(blockwise_x)), batch_shape + [6]
      )
      self.assertAllEqual(
          self.evaluate(tf.shape(blockwise_ildj)), batch_shape + []
      )
  
      expl_y = tf.concat(
          [
              e.forward(x[..., :2]),
              sp.forward(x[..., 2:3]),
              aff.forward(x[..., 3:]),
          ],
          axis=-1,
      )
      expl_fldj = sum(
          [
              e.forward_log_det_jacobian(x[..., :2], event_ndims=1),
              sp.forward_log_det_jacobian(x[..., 2:3], event_ndims=1),
              aff.forward_log_det_jacobian(x[..., 3:], event_ndims=1),
          ]
      )
      expl_x = tf.concat(
          [
              e.inverse(expl_y[..., :2]),
              sp.inverse(expl_y[..., 2:3]),
              aff.inverse(expl_y[..., 3:]),
          ],
          axis=-1,
      )
      expl_ildj = sum(
          [
              e.inverse_log_det_jacobian(
                  expl_y[..., :2], event_ndims=1
              ),
              sp.inverse_log_det_jacobian(
                  expl_y[..., 2:3], event_ndims=1
              ),
              aff.inverse_log_det_jacobian(
                  expl_y[..., 3:], event_ndims=1
              ),
          ]
      )
  
      self.assertAllClose(
          self.evaluate(expl_y), self.evaluate(blockwise_y)
      )
      self.assertAllClose(
          self.evaluate(expl_fldj), self.evaluate(blockwise_fldj)
      )
      self.assertAllClose(
          self.evaluate(expl_x), self.evaluate(blockwise_x)
      )
      self.assertAllClose(
          self.evaluate(expl_ildj), self.evaluate(blockwise_ildj)
      )
  
imports: from absl.testing import parameterized
  import mock
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import blockwise
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import inline
  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.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling the BlockwiseBijectorTest obj's underlying member method code with example usage: obj.testExplicitBlocks(dynamic_shape, batch_shape) without return types