text.py 109 Bytes
Newer Older
Pan,Huiwen's avatar
Pan,Huiwen committed
1
2
3
4
5
6
7
8
9
10
11
import torch

PAD = 0


def mask(x):
    return x != PAD


def torch_long(x):
    return torch.LongTensor(x)