code: def _wrap_as_distributions(structure):
      return tf.nest.map_structure(
          lambda x: independent.Independent(  # pylint: disable=g-long-lambda
              deterministic.Deterministic(x),
              # Particles are a batch dimension.
              reinterpreted_batch_ndims=tf.rank(x) - 1,
          ),
          structure,
      )
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/particle_filter_augmentation.py
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import joint_distribution_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 2 for calling a global function with example usage: _wrap_as_distributions(structure) and returns: tf