File size: 274 Bytes
8044721
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3
# coding=utf-8

import torch
from data.field.mini_torchtext.field import RawField


class BasicField(RawField):
    def process(self, example, device=None):
        tensor = torch.tensor(example, dtype=torch.long, device=device)
        return tensor