t3toolbox.tucker_tensor_train.t3_core_shapes#

t3toolbox.tucker_tensor_train.t3_core_shapes(shape: t3toolbox.backend.common.typ.Sequence[int], tucker_ranks: t3toolbox.backend.common.typ.Sequence[int], tt_ranks: t3toolbox.backend.common.typ.Sequence[int], stack_shape: t3toolbox.backend.common.typ.Sequence[int] = ()) t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, Ellipsis], t3toolbox.backend.common.typ.Tuple[int, Ellipsis]]#

Compute the tucker and TT backend shapes for a Tucker tensor train.

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.corewise as cw
>>> x = t3.t3_corewise_randn((14,15,16), (4,5,6), (1,3,4,5), stack_shape=(9,))
>>> print(t3.t3_core_shapes(x.shape, x.tucker_ranks, x.tt_ranks, stack_shape=x.stack_shape))
(((9, 4, 14), (9, 5, 15), (9, 6, 16)), ((9, 1, 4, 3), (9, 3, 5, 4), (9, 4, 6, 5)))
>>> print(x.core_shapes)
(((9, 4, 14), (9, 5, 15), (9, 6, 16)), ((9, 1, 4, 3), (9, 3, 5, 4), (9, 4, 6, 5)))