| 16 | |
| 17 | |
| 18 | class IndexedTensorDataset(): |
| 19 | def __init__(self, x, y): |
| 20 | self.x = x |
| 21 | self.y = y |
| 22 | |
| 23 | def __getitem__(self, idx): |
| 24 | x, y = self.x[idx], self.y[idx] |
| 25 | ''' transform HWC pic to CWH pic ''' |
| 26 | x = torch.tensor(x, dtype=torch.float32).permute(2,0,1) |
| 27 | return x, y, idx |
| 28 | |
| 29 | def __len__(self): |
| 30 | return len(self.x) |
| 31 | |
| 32 | |
| 33 | class Dataset(): |
nothing calls this directly
no outgoing calls
no test coverage detected