mirror of https://github.com/hpcaitech/ColossalAI
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
340 B
20 lines
340 B
3 years ago
|
#!/usr/bin/env python
|
||
|
# -*- encoding: utf-8 -*-
|
||
|
|
||
|
from abc import ABC, abstractmethod
|
||
|
|
||
|
|
||
|
class BaseSampler(ABC):
|
||
|
|
||
|
def __init__(self, dataset, batch_size):
|
||
|
self.dataset = dataset
|
||
|
self.batch_size = batch_size
|
||
|
|
||
|
@abstractmethod
|
||
|
def __len__(self):
|
||
|
pass
|
||
|
|
||
|
@abstractmethod
|
||
|
def __iter__(self):
|
||
|
pass
|