Method
__init__
(
self,
dataset: Dataset,
shuffle: bool = True,
seed: int = 0,
drop_last: bool = False,
batch_size: int = 1,
)
Source from the content-addressed store, hash-verified
| 174 | """ |
| 175 | |
| 176 | def __init__( |
| 177 | self, |
| 178 | dataset: Dataset, |
| 179 | shuffle: bool = True, |
| 180 | seed: int = 0, |
| 181 | drop_last: bool = False, |
| 182 | batch_size: int = 1, |
| 183 | ) -> None: |
| 184 | assert hasattr(dataset, 'loads'), 'Dataset must have "loads" attribute to use BalancedResumableSampler' |
| 185 | super().__init__(dataset, shuffle, seed, drop_last) |
| 186 | self.batch_size = batch_size |
| 187 | self.loads = dataset.loads |
| 188 | |
| 189 | def __iter__(self) -> Iterator: |
| 190 | if self.shuffle: |
Callers
nothing calls this directly
Tested by
no test coverage detected