ssa-perin / data /field /basic_field.py
larkkin's picture
Add application code and models, update README
8044721
raw
history blame contribute delete
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