ssa-perin / data /field /basic_field.py
larkkin's picture
Add code and readme
c45d283
raw
history blame contribute delete
No virus
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