code: def _slice_params_to_dict(
      batch_object, slices, bijector_x_event_ndims=None
  ):
      """Computes the override dictionary of sliced parameters.
  
      Args:
        batch_object: The tfd.Distribution being batch-sliced.
        slices: Slices as received by __getitem__.
        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:
        overrides: `str->Tensor` `dict` of batch-sliced parameter overrides.
      """
  
      if bijector_x_event_ndims is None:
          batch_shape = batch_object.batch_shape_tensor()
      else:
          batch_shape = batch_object.experimental_batch_shape_tensor(
              x_event_ndims=bijector_x_event_ndims
          )
      return batch_shape_lib.map_fn_over_parameters_with_event_ndims(
          batch_object,
          functools.partial(
              _slice_single_param,
              slices=slices,
              batch_shape=batch_shape,
          ),
          bijector_x_event_ndims=bijector_x_event_ndims,
      )
  
file_path: probability/tensorflow_probability/python/internal/slicing.py
imports: import collections
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import batch_shape_lib
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 3 for calling a global function with example usage: _slice_params_to_dict(batch_object, slices, bijector_x_event_ndims) and returns: batch_shape_lib