import torch


def multi_one_hot(actions, action_shape):
    """
    transforms a list of actions into a list of one hot encoded vectors
    :param actions: (list int) the list of action indices
    :param action_shape: (int) the maximum number of entries in the one hot
    vector
    :return: the created sequence
    """
    l = len(actions)
    full_vec = torch.zeros((l, action_shape))
    full_vec[range(l), actions] = 1.
    return full_vec.unsqueeze(0)