random_tt#

ivy.random_tt(shape, rank, /, *, full=False, dtype=None, seed=None)[source]#

Generate a random TT/MPS tensor.

Parameters:
  • shape (Sequence[int]) – shape of the tensor to generate

  • rank (Union[Sequence[int], int]) – rank of the TT decomposition must verify rank[0] == rank[-1] ==1 (boundary conditions) and len(rank) == len(shape)+1

  • full (Optional[bool], default: False) – if True, a full tensor is returned otherwise, the decomposed tensor is returned

  • seed (Optional[int], default: None) – seed for generating random numbers

Return type:

Union[TTTensor, Array]

Returns:

ivy.TTTensor