MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / __iter__

Method __iter__

lib/utils/data/sampler.py:117–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 self.drop_last = drop_last
116
117 def __iter__(self):
118 batch = []
119 for idx in self.sampler:
120 batch.append(idx)
121 if len(batch) == self.batch_size:
122 yield batch
123 batch = []
124 if len(batch) > 0 and not self.drop_last:
125 yield batch
126
127 def __len__(self):
128 if self.drop_last:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected