mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-07-15 11:25:33 +08:00
22 lines
375 B
Python
22 lines
375 B
Python
from abc import ABC, abstractmethod
|
|
|
|
from typing import Any, Dict, Sized, Iterable, NamedTuple
|
|
|
|
|
|
DataEntry = Dict[str, Any]
|
|
|
|
|
|
class SourceContext(NamedTuple):
|
|
source: str
|
|
row: int
|
|
|
|
|
|
class Dataset(Sized, Iterable[DataEntry], ABC):
|
|
@abstractmethod
|
|
def __iter__(self) -> Iterable[DataEntry]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def __len__(self):
|
|
pass
|