kolda_fold

# Import statement

from hottbox.core import kolda_fold
kolda_fold(matrix, mode, shape)[source]

Fold a 2D array into a N-dimensional array.

Parameters
matrixnp.ndarray

Unfolded version of a tensor

modeint

A mode along which original tensor was unfolded into a matrix

shapetuple

Shape of the original tensor before it was unfolded

Returns
tensornp.ndarray

N-dimensional array of the original shape

Notes

  1. Much slower then fold

  2. At the moment it reverts unfolding operation (kolda_unfold). Will be generalised in a future