MCPcopy Create free account
hub / github.com/LargeWorldModel/LWM / __iter__

Method __iter__

lwm/data.py:642–649  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

640 yield example
641
642 def __iter__(self):
643 if self.config.mode == 'pad':
644 fn = self._iter_pad
645 elif self.config.mode == 'no_pad':
646 fn = self._iter_no_pad
647 else:
648 raise ValueError(f'Unknown mode: {self.config.mode}')
649 return fn()
650
651 def _iter_pad(self):
652 chunk_size = self.config.batch_size * self.config.seq_length

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected