MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __iter__

Method __iter__

monai/data/iterable_dataset.py:53–63  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 self.source: Iterator[Any] | None = None
52
53 def __iter__(self):
54 info = get_worker_info()
55 num_workers = info.num_workers if info is not None else 1
56 id = info.id if info is not None else 0
57
58 self.source = iter(self.data)
59 for i, item in enumerate(self.source):
60 if i % num_workers == id:
61 if self.transform is not None:
62 item = apply_transform(self.transform, item)
63 yield item
64
65
66class ShuffleBuffer(Randomizable, IterableDataset):

Callers

nothing calls this directly

Calls 1

apply_transformFunction · 0.90

Tested by

no test coverage detected