# tensor_train#

ivy.tensor_train(input_tensor, rank, /, *, svd='truncated_svd', verbose=False)[source]#

TT decomposition via recursive SVD.

Decomposes the input into a sequence of order-3 tensors (factors) Also known as Tensor-Train decomposition _

Parameters:
• input_tensor (`Union`[`Array`, `NativeArray`]) – tensor to decompose

• rank (`Union`[`int`, `Sequence`[`int`]]) – maximum allowable TT rank of the factors if int, then this is the same for all the factors if int list, then rank[k] is the rank of the kth factor

• svd (`Optional`[`Literal`[`'truncated_svd'`]], default: `'truncated_svd'`) – function to use to compute the SVD

• verbose (`Optional`[`bool`], default: `False`) – level of verbosity

Return type:

`TTTensor`

Returns:

• factors – order-3 tensors of the TT decomposition

•  (Ivan V. Oseledets. “Tensor-train decomposition”,)

• SIAM J. Scientific Computing, 33(5) (2295–2317, 2011.)

Array.tensor_train(self, rank, /, svd='truncated_svd', verbose=False)[source]#

ivy.Array instance method variant of ivy.tensor_train. This method simply wraps the function, and so the docstring for ivy.tensor_train also applies to this method with minimal changes.

Parameters:
• self (`Union`[`Array`, `NativeArray`]) – input tensor

• rank (`Union`[`int`, `Sequence`[`int`]]) – maximum allowable TT rank of the factors if int, then this is the same for all the factors if int list, then rank[k] is the rank of the kth factor

• svd (`Optional`[`Literal`[`'truncated_svd'`]], default: `'truncated_svd'`) – function to use to compute the SVD

• verbose (`Optional`[`bool`], default: `False`) – level of verbosity

Return type:

`TTTensor`

Returns:

ivy.TTTensor

Container.tensor_train(self, rank, /, *, svd='truncated_svd', verbose=False, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)[source]#

ivy.Container instance method variant of ivy.tensor_train. This method simply wraps the function, and so the docstring for ivy.tensor_train also applies to this method with minimal changes.

Parameters:
• input_tensor – tensor to be decomposed.

• rank (`Union`[`Sequence`[`int`], `Container`]) – maximum allowable TT-ranks of the decomposition.

• svd (`Optional`[`Union`[`Literal`[`'truncated_svd'`], `Container`]], default: `'truncated_svd'`) – SVD method to use.

• verbose (`Optional`[`Union`[`bool`, `Container`]], default: `False`) – level of verbosity.

Return type:

`Tuple`[`Container`, `Sequence`[`Container`]]