(self, index: int)
| 23 | return self.length |
| 24 | |
| 25 | def __getitem__(self, index: int): |
| 26 | if isinstance(self.dataset, IterableDataset): |
| 27 | if self.dataset_iterator is None: |
| 28 | self.dataset_iterator = iter(self.dataset) |
| 29 | return next(self.dataset_iterator) |
| 30 | |
| 31 | random_index = torch.randint(0, len(self.dataset), tuple()) |
| 32 | return self.dataset[random_index.item()] |
nothing calls this directly
no outgoing calls
no test coverage detected