ut3_to_t3#
- t3toolbox.backend.ut3_conversions.ut3_to_t3(x)#
def ut3_to_t3( x: typ.Tuple[ NDArray, # tucker_supercore NDArray, # tt_supercore typ.Tuple[int, ...], # shape, static int tuple typ.Tuple[NDArray, NDArray], # (tucker_edge_mask, tt_edge_mask) ], ) -> typ.Union[ typ.Tuple[typ.Tuple[NDArray, ...], typ.Tuple[NDArray, ...]], # (tucker_cores, tt_cores), if unstacked typ.Tuple, # else a nested tree (shape stack_shape) of those ]:
Convert uniform supercores + masks back to ragged TuckerTensorTrain core pairs.
Unstacked: returns one
(tucker_cores, tt_cores). Stacked: returns a nested tuple (shaped likestack_shape) of such pairs – a tree, since a varying-rank stack has no single stackedTuckerTensorTrain(docs/uniform_ranks_and_varieties.md). The real sub-blocks are selected through the rank masks (boolean indexing, ascending order) rather than by slicing a prefix, since an edge mask may be gappy after+/x(docs/uniform_masks_vs_ranks.md).- Parameters:
x (t3toolbox.backend.common.typ.Tuple[NDArray, NDArray, t3toolbox.backend.common.typ.Tuple[int, Ellipsis], t3toolbox.backend.common.typ.Tuple[NDArray, NDArray]])
- Return type:
t3toolbox.backend.common.typ.Union[t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis], t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]], t3toolbox.backend.common.typ.Tuple]