import torch


def prepare_sequence(seq, to_ix):
    """return indexes sequence of input word sequence

    Args:
        seq (list): word sequence
        to_ix (dict): word to index map

    Returns:
        Tensor: indexes in Tensor format
    """
    idxs = [to_ix[w] for w in seq]
    return torch.tensor(idxs, dtype=torch.long)