groups_to_labels ================ .. py:function:: t3toolbox.backend.sharing.groups_to_labels(groups) .. code-block:: python def groups_to_labels( groups: typ.Tuple[typ.Tuple[int, ...], ...], # static; canonical form (validate_sharing) ) -> typ.Tuple[int, ...]: # len=d, static; the per-mode label spec The inverse of :py:func:`validate_sharing`: per-mode integer labels for a canonical partition (``validate_sharing(groups_to_labels(g), shape) == g``). .. rubric:: Examples >>> import t3toolbox.backend.sharing as sharing >>> sharing.groups_to_labels(((0, 2), (1,))) (0, 1, 0)