class_docstr: Converts between nested structures of Tensors.
  
  This is useful when constructing non-trivial chains of multipart bijectors.
  It partitions inputs into different logical "blocks", which may be fed as
  arguments to downstream multipart bijectors.
  
  Example Usage:
  
    ```python
  
    # Pack a 3-element list of tensors into a dict. The output structure,
    # `structure_1`, is defined as a dict in which the values are list
    # indices.
    structure_1 = {'a': 1, 'b': 2, 'c': 0}
    list_to_dict = Restructure(output_structure=structure_1)
    input_list = [0.01, 0.02, 0.03]
    assert list_to_dict.forward(input_list) == {
      'a': 0.02, 'b': 0.03, 'c': 0.01}
  
    # Now assume that, instead of a list/tuple (the default), the input
    # structure is another dict. The output structure is the same as
    # defined above, and consecutive integers are again used to associate
    # components of the input and output structures.
    structure_2 = {'c': 2, 'd': 1, 'e': 0}
    dict_to_dict = Restructure(
      structure_1, input_structure=structure_2)
    input_dict = {'c': -3.5, 'd': 96.0, 'e': 12.0}
    assert dict_to_dict.forward(input_dict) == {
      'a': 96.0, 'b': -3.5, 'c': 12.0}
  
    # Restructure a dict to a namedtuple.
    Example = collections.namedtuple('Example', ['x', 'y', 'z'])
    structure_3 = Example(2, 0, 1)
    namedtuple_to_dict = Restructure(structure_3, input_structure=structure_2)
    assert namedtuple_to_dict(input_dict) == Example(x=-3.5, y=12.0, z=96.0)
  
    assert namedtuple_to_dict.inverse(Example(x=0.01, y=0.02, z=0.03)) == {
      'c': 0.01, 'd': 0.03, 'e': 0.02}
  
    # Restructure can be applied to structures of mixed type and arbitrary
    # depth:
    restructure = Restructure({
      'foo': [0, 1],
      'bar': [3, 2],
      'baz': [4, 5, 6]
    })
  
    # Note that x is a *python-list* of tensors.
    # To permute elements of an individual Tensor, see `tfb.Permute`.
    x = [1, 2, 4, 8, 16, 32, 64]
  
    assert restructure.forward(x) == {
        'foo': [1, 2],
        'bar': [8, 4],
        'baz': [16, 32, 64]
    }
  
    # Where Restructure is useful:
    complex_bijector = Chain([
      # Apply different transformations to each block.
      JointMap({
        'foo': ScaleMatVecLinearOperator(...),  # Operates on the full block
        'bar': ScaleMatVecLinearOperator(...),  # Operates on the full block
        'baz': [Exp(), Scale(10.), Shift(-1.)]  # Different bijectors for each
      }),
      # Group the tensor into logical blocks.
      Restructure({
        'foo': [0, 1],
        'bar': [3, 2],
        'baz': [4, 5, 6],
      }),
      # Split an input tensor into 7 chunks.
      Split([2, 4, 6, 8, 10, 12, 14])
    ])
    ```
code: def inverse_event_ndims(self, y_ndims, **kwargs):
      return self._inverse(y_ndims)
  
imports: import six
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import invert
  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.python.util import nest
label_desc: Use image node_id 14 for calling the Restructure obj's underlying member method code with example usage: obj.inverse_event_ndims(y_ndims) and returns: self