code: def broadcast_structure(to_structure, from_structure):
      """Broadcasts `from_structure` to `to_structure`.
  
      This is useful for downstream usage of `zip` or `tf.nest.map_structure`.
  
      If `from_structure` is a singleton, it is tiled to match the structure of
      `to_structure`. Note that the elements in `from_structure` are not copied if
      this tiling occurs.
  
      Args:
        to_structure: A structure.
        from_structure: A structure.
  
      Returns:
        new_from_structure: Same structure as `to_structure`.
  
      #### Example:
  
      ```python
      a_structure = ['a', 'b', 'c']
      b_structure = broadcast_structure(a_structure, 'd')
      # -> ['d', 'd', 'd']
      c_structure = tf.nest.map_structure(
          lambda a, b: a + b, a_structure, b_structure)
      # -> ['ad', 'bd', 'cd']
      ```
      """
      from_parts = tf.nest.flatten(from_structure)
      if len(from_parts) == 1:
          from_structure = tf.nest.map_structure(
              lambda _: from_parts[0], to_structure
          )
      return from_structure
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: broadcast_structure(to_structure, from_structure) and returns: from_structure