code: def unpack_structs_like(template, packed):
      """Converts a structure of tuples like `template` to a tuple of structures."""
      return tuple(
          nest.pack_sequence_as(template, flat)
          for flat in zip(
              *nest.flatten_up_to(template, packed, check_types=False)
          )
      )
  
imports: import collections
  import functools
  import sys
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import ldj_ratio
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling a global function with example usage: unpack_structs_like(template, packed) and returns: tuple