Schedule computing new batch from source callback by the parallel pool.
(self, pool, context_i, lead, batch_size, epoch_idx)
| 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.""" |
| 243 | if self.batch: |
| 244 | return pool.schedule_batch( |
| 245 | context_i, _TaskArgs.make_batch(self.callback_args(None, epoch_idx, lead=lead)) |
| 246 | ) |
| 247 | else: |
| 248 | sample_range_start = self.current_sample + batch_size * lead |
| 249 | sample_range_end = sample_range_start + batch_size |
| 250 | iteration = self.current_iter + lead |
| 251 | sample_range = _SampleRange(sample_range_start, sample_range_end, iteration, epoch_idx) |
| 252 | work_batch = _TaskArgs.make_sample(sample_range) |
| 253 | return pool.schedule_batch(context_i, work_batch) |
| 254 | |
| 255 | def schedule_and_receive(self, pipeline, pool, context_i, batch_size, epoch_idx): |
| 256 | """Obtain the computed results of calling source callback in parallel pool and feed |
no test coverage detected