t3_from_vector#
- t3toolbox.backend.t3_conversions.t3_from_vector(x_flat, shape, tucker_ranks, tt_ranks, stack_shape=())#
def t3_from_vector( x_flat: NDArray, # shape=(x_size,), all core entries flattened shape: typ.Sequence[int], # len=d, the tensor mode sizes (N0,...,N(d-1)) tucker_ranks: typ.Sequence[int], # len=d tt_ranks: typ.Sequence[int], # len=d+1 stack_shape: typ.Sequence[int] = (), # leading batch axes ) -> typ.Tuple[ typ.Sequence[NDArray], # tucker_cores. len=d, elm_shape=stack_shape+(ni,Ni) typ.Sequence[NDArray], # tt_cores. len=d, elm_shape=stack_shape+(rLi,ni,rR(i+1)) ]:
Constructs a T3 from a 1D vector containing the core entries
- Parameters:
x_flat (NDArray)
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])
- Return type:
t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]]