(self)
| 391 | self.shuffle = shuffle |
| 392 | |
| 393 | def __iter__(self) -> Iterable: |
| 394 | g = torch.Generator() |
| 395 | g.manual_seed(self.epoch) |
| 396 | |
| 397 | sortish_data = [self.dataset.src_lens[i] for i in self.available_indices] |
| 398 | sortish_indices = sortish_sampler_indices(sortish_data, self.batch_size, shuffle=self.shuffle) |
| 399 | indices = [self.available_indices[i] for i in sortish_indices] |
| 400 | assert len(indices) == self.num_samples |
| 401 | return iter(indices) |
| 402 | |
| 403 | @cached_property |
| 404 | def available_indices(self) -> np.array: |
nothing calls this directly
no test coverage detected