(self, pool, context_i, batch_size, epoch_idx)
| 230 | self.current_sample = 0 |
| 231 | |
| 232 | def prefetch(self, pool, context_i, batch_size, epoch_idx): |
| 233 | # NOTE We can't schedule more than what's on top of pipeline's prefetch queue, as the |
| 234 | # entires in the pipeline are zero-copy and cannot be overwritten. |
| 235 | context = pool.contexts[context_i] |
| 236 | while context.scheduled_ahead < self.prefetch_queue_depth and self.schedule_batch( |
| 237 | pool, context_i, context.scheduled_ahead, batch_size, epoch_idx |
| 238 | ): |
| 239 | pass |
| 240 | |
| 241 | def schedule_batch(self, pool, context_i, lead, batch_size, epoch_idx): |
| 242 | """Schedule computing new batch from source callback by the parallel pool.""" |
no test coverage detected