(self, element_names, element_sizes)
Initializes a new `RaggedNamedAxis` instance.

    Args:
      element_names: A list or array containing the element names.
      element_sizes: A list or array containing the size of each element.
Initializes a new `RaggedNamedAxis` instance.
Initializes a new RaggedNamedAxis instance .
def __init__(self, element_names, element_sizes):
    """Initializes a new `RaggedNamedAxis` instance.

    Args:
      element_names: A list or array containing the element names.
      element_sizes: A list or array containing the size of each element.
    """
    names_to_slices = {}
    names_to_indices = {}

    offset = 0
    for name, size in zip(element_names, element_sizes):
      # Don't add unnamed elements to the dicts.
      if name:
        names_to_slices[name] = slice(offset, offset + size)
        names_to_indices[name] = range(offset, offset + size)
      offset += size

    self._names = element_names
    self._sizes = element_sizes
    self._names_to_slices = names_to_slices
    self._names_to_indices = names_to_indices
def __init__ ( self , element_names , element_sizes ) : names_to_slices = { } names_to_indices = { } offset = 0 for name , size in zip ( element_names , element_sizes ) : # Don't add unnamed elements to the dicts. if name : names_to_slices [ name ] = slice ( offset , offset + size ) names_to_indices [ name ] = range ( offset , offset + size ) offset += size self . _names = element_names self . _sizes = element_sizes self . _names_to_slices = names_to_slices self . _names_to_indices = names_to_indices