ut3_stack#

t3toolbox.backend.ut3_operations.ut3_stack(xx)#
def ut3_stack(
        xx,  # nested tuple (shaped like stack_shape) of unstacked uniform-T3 .data leaves
) -> typ.Tuple[
    NDArray,                          # tucker_supercore
    NDArray,                          # tt_supercore
    typ.Tuple[int, ...],              # shape
    typ.Tuple[NDArray, NDArray],      # (tucker_edge_mask, tt_edge_mask)
]:

Stack an array-like tree of uniform Tucker tensor trains into one.

Inverse of ut3_unstack(): stacks the supercores and rank masks onto axes 1 .. num_levels (after the mode index), keeping the shared shape unstacked. Only the four ndarray components go through stacking.stack; shape (a Sequence the walker would recurse into) is read once from the first leaf and re-attached.

Return type:

t3toolbox.backend.common.typ.Tuple[NDArray, NDArray, t3toolbox.backend.common.typ.Tuple[int, Ellipsis], t3toolbox.backend.common.typ.Tuple[NDArray, NDArray]]