MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __init__

Method __init__

deepspeed/runtime/dataloader.py:19–27  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

17class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected