code: def broadcast_parameters_with_batch_shape(
      batch_object, batch_shape, bijector_x_event_ndims=None
  ):
      """Broadcasts each parameter's batch shape with the given `batch_shape`.
  
      This returns a dict of parameters to `batch_object` broadcast with the given
      batch shape. It can be understood as a pseudo-inverse operation to batch
      slicing:
  
      ```python
      dist = tfd.Normal(0., 1.)
      # ==> `dist.batch_shape == []`
      broadcast_dist = dist._broadcast_parameters_with_batch_shape([3])
      # ==> `broadcast_dist.batch_shape == [3]`
      #     `broadcast_dist.loc.shape == [3]`
      #     `broadcast_dist.scale.shape == [3]`
      sliced_dist = broadcast_dist[0]
      # ==> `sliced_dist.batch_shape == []`.
      ```
  
      Args:
        batch_object: Python object, typically a `tfd.Distribution` or
          `tfb.Bijector`. This must implement the method
          `batched_object.parameter_properties()` and expose a dict
          `batched_object.parameters` of the parameters passed to its constructor.
        batch_shape: Integer `Tensor` batch shape.
        bijector_x_event_ndims: If `batch_object` is a bijector, this is the
          (structure of) integer(s) value of `x_event_ndims` in the current context
          (for example, as passed to `experimental_batch_shape`). Otherwise, this
          argument should be `None`.
          Default value: `None`.
  
      Returns:
        updated_parameters: Python `dict` mapping names of parameters from
          `batch_object.parameter_properties()` to broadcast values.
      """
      return map_fn_over_parameters_with_event_ndims(
          batch_object,
          functools.partial(
              broadcast_parameter_with_batch_shape,
              batch_shape=batch_shape,
          ),
          bijector_x_event_ndims=bijector_x_event_ndims,
      )
  
file_path: probability/tensorflow_probability/python/internal/batch_shape_lib.py
imports: import functools
  from absl import logging
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 8 for calling a global function with example usage: broadcast_parameters_with_batch_shape(batch_object, batch_shape, bijector_x_event_ndims) and returns: map_fn_over_parameters_with_event_ndims