add files

This commit is contained in:
烨玮
2025-02-20 12:17:03 +08:00
parent a21dd4555c
commit edd008441b
667 changed files with 473123 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from abc import ABC
from abc import abstractmethod
from typing import Iterator
from typing import Tuple
from torch.utils.data import Sampler
class AbsSampler(Sampler, ABC):
@abstractmethod
def __len__(self) -> int:
raise NotImplementedError
@abstractmethod
def __iter__(self) -> Iterator[Tuple[str, ...]]:
raise NotImplementedError
def generate(self, seed):
return list(self)