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 testSmartConstructors(self):
      x = collections.OrderedDict(
          [
              ("a", [1, 2, 3]),
              ("b", [4, 5, 6]),
              ("c", 7.0),
              ("d", 8.0),
              ("e", 9.0),
          ]
      )
      bij = restructure.tree_flatten(x)
  
      bij_2 = restructure.pack_sequence_as(x)
  
      # Invert assertion arguments to infer structure from bijector output.
      self.assertAllEqualNested(
          bij.forward(x), [1, 2, 3, 4, 5, 6, 7, 8, 9], check_types=True
      )
      self.assertAllEqualNested(
          bij_2.forward(bij.forward(x)), x, check_types=True
      )
  
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 3 for calling the RestructureBijectorTest obj's underlying member method code with example usage: obj.testSmartConstructors() without return types