(self)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected