tucker_tensor(shape, rank, full=False, random_state=None)[source]

Generates a random Tucker tensor


shape : tuple

shape of the tensor to generate

rank : int or int list

rank of the Tucker decomposition if int, the same rank is used for each mode otherwise, dimension of each mode

full : bool, optional, default is False

if True, a full tensor is returned otherwise, the decomposed tensor is returned

random_state : np.random.RandomState


tucker_tensor : ND-array or (ND-array, 2D-array list)

ND-array : full tensor if full is True (ND-array, 2D-array list) : core tensor and list of factors otherwise