(self, train_set, val_set, batch_size, test_batch_size, num_workers=16)
| 7 | """ Splits the datasets in TRAIN, VALIDATION. """ |
| 8 | |
| 9 | def __init__(self, train_set, val_set, batch_size, test_batch_size, num_workers=16): |
| 10 | super().__init__() |
| 11 | |
| 12 | self.train_set = train_set |
| 13 | self.val_set = val_set |
| 14 | self.batch_size = batch_size |
| 15 | self.test_batch_size = test_batch_size |
| 16 | if train_set.data.device.type != cst.DEVICE: #this is true only when we are using a GPU but the data is still on the CPU |
| 17 | self.pin_memory = True |
| 18 | else: |
| 19 | self.pin_memory = False |
| 20 | self.num_workers = num_workers |
| 21 | |
| 22 | def train_dataloader(self): |
| 23 | return DataLoader( |
nothing calls this directly
no outgoing calls
no test coverage detected