import torch


def get_tensor(vector, n_time_steps, n_samples):
    """
    Inverse function of get_vector()
    - input: np.ndarray(n_time_steps * n_samples, n_features)
    - output: torch.tensor(n_time_steps, n_samples, n_features) 
    where:
    output[0, 0:n_samples, :] = input[0:n_samples, :],
    output[1, 0:n_samples, :] = input[n_samples:2*n_samples,:],
    ..."""
    assert n_time_steps * n_samples == vector.shape[0], "Inconsistent sizes"
    n_features = vector.shape[1] if len(vector.shape) > 1 else 1
    return torch.tensor(vector).reshape(n_time_steps, n_samples, n_features)