import torch


def pad_data(seqs):
    """Pads sequences with zero for minibatch processing."""
    lengths = [len(s) for s in seqs]
    max_len = max(lengths)
    out = torch.LongTensor([s + [0] * (max_len - len_) for
                            s, len_ in zip(seqs, lengths)]).t()
    return out