- fold(unfolded_tensor, mode, shape)
Refolds the mode-mode unfolding into a tensor of shape shape
In other words, refolds the n-mode unfolded tensor into the original tensor of the specified shape.
unfolded tensor of shape
the mode of the unfolding
shape of the original tensor before unfolding
folded_tensor of shape shape