MCPcopy Create free account
hub / github.com/LeonardoBerti00/DeepMarket / __init__

Method __init__

preprocessing/DataModule.py:9–20  ·  view source on GitHub ↗
(self, train_set, val_set, batch_size, test_batch_size,  num_workers=16)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected