mirror of
https://github.com/HumanAIGC/lite-avatar.git
synced 2026-02-05 18:09:20 +08:00
add files
This commit is contained in:
19
funasr_local/samplers/abs_sampler.py
Normal file
19
funasr_local/samplers/abs_sampler.py
Normal 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)
|
||||
Reference in New Issue
Block a user