def unfolding(tens, i):
    """Compute the i-th unfolding of a tensor."""
    return reshape(tens.full(), (np.prod(tens.n[0:(i+1)]), -1))
def unfolding ( tens , i ) : return reshape ( tens . full ( ) , ( np . prod ( tens . n [ 0 : ( i + 1 ) ] ) , - 1 ) )
Compute the i-th unfolding of a tensor.