| 153 | |
| 154 | |
| 155 | class InfiniteSampler(data.sampler.Sampler): |
| 156 | def __init__(self, data_source): |
| 157 | self.data_source = data_source |
| 158 | |
| 159 | def __iter__(self): |
| 160 | while True: |
| 161 | yield from iter(torch.randperm(len(self.data_source)).tolist()) |
| 162 | |
| 163 | def __len__(self): |
| 164 | return 2 ** 31 |
nothing calls this directly
no outgoing calls
no test coverage detected