(self, idx: int)
| 142 | return len(self.dataset) |
| 143 | |
| 144 | def __getitem__(self, idx: int) -> Tuple[torch.Tensor, int]: |
| 145 | if idx in self.cache: |
| 146 | return self.cache[idx] |
| 147 | |
| 148 | item = self.dataset[idx] |
| 149 | |
| 150 | if len(self.cache) < self.cache_size: |
| 151 | self.cache[idx] = item |
| 152 | |
| 153 | return item |
| 154 | |
| 155 | class MultiScaleDataset(Dataset): |
| 156 | def __init__( |
nothing calls this directly
no outgoing calls
no test coverage detected