perin / data /field /basic_field.py
Larisa Kolesnichenko
Add the original perin code
1d5604f
raw
history blame
274 Bytes
#!/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