(self, dataset, limit)
| 20 | |
| 21 | class Subset(torch.utils.data.Dataset): |
| 22 | def __init__(self, dataset, limit): |
| 23 | indices = torch.randperm(len(dataset))[:limit] |
| 24 | self.dataset = dataset |
| 25 | self.indices = indices |
| 26 | |
| 27 | def __getitem__(self, idx): |
| 28 | return self.dataset[self.indices[idx]] |
nothing calls this directly
no outgoing calls
no test coverage detected