MCPcopy Create free account
hub / github.com/MotrixLab/insactor / InfiniteSampler

Class InfiniteSampler

diffmimic/utils/data.py:155–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153
154
155class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected