class_docstr: Tests the correctness of the Y = Restructure({nested}) transformation.
class_docstr_tok: ["Tests","the","correctness","of","the","Y","=","Restructure","(","{","nested","}",")","transformation","."]
code: def testCompositeTensor(self):
      bij = restructure.Restructure(
          {"foo": [1, 2], "bar": 0, "baz": (3, 4)}
      )
  
      x = [[1, 2, 3], [4, 5, 6], 7.0, 8.0, 9.0]
      flat = tf.nest.flatten(bij, expand_composites=True)
      unflat = tf.nest.pack_sequence_as(
          bij, flat, expand_composites=True
      )
      self.assertAllCloseNested(
          bij.forward(x), tf.function(lambda b_: b_.forward(x))(unflat)
      )
  
file_path: probability/tensorflow_probability/python/bijectors/restructure_test.py
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import restructure
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 7 for calling the RestructureBijectorTest obj's underlying member method code with example usage: obj.testCompositeTensor() without return types