Wraps an iterator to allow for infinite iteration. This is especially useful for DataLoader types that we wish to automatically restart upon completion. Args: loader (iterator): The data loader to repeat.
(self, loader)
| 17 | class RepeatingLoader: |
| 18 | |
| 19 | def __init__(self, loader): |
| 20 | """Wraps an iterator to allow for infinite iteration. This is especially useful |
| 21 | for DataLoader types that we wish to automatically restart upon completion. |
| 22 | |
| 23 | Args: |
| 24 | loader (iterator): The data loader to repeat. |
| 25 | """ |
| 26 | self.loader = loader |
| 27 | self.data_iter = iter(self.loader) |
| 28 | |
| 29 | def __iter__(self): |
| 30 | return self |
nothing calls this directly
no outgoing calls
no test coverage detected