(loader, sampler, start_epoch, start_iter)
| 39 | |
| 40 | |
| 41 | def sample_data(loader, sampler, start_epoch, start_iter): |
| 42 | epoch = start_epoch |
| 43 | while True: |
| 44 | sampler.set_epoch(epoch) |
| 45 | begin_iter = start_iter if epoch == start_epoch else 0 |
| 46 | epoch += 1 |
| 47 | for _, batch in enumerate(loader, start=begin_iter): |
| 48 | yield batch |
| 49 | |
| 50 | |
| 51 | def main(args): |