random_cp#

ivy.random_cp(shape, rank, /, *, dtype=None, full=False, orthogonal=False, seed=None, normalise_factors=True)[source]#

Generate a random CP tensor.

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

  • rank (int) – rank of the CP decomposition

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

  • orthogonal (Optional[bool], default: False) – if True, creates a tensor with orthogonal components

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

Return type:

Union[CPTensor, Array]

Returns:

ivy.CPTensor