MCPcopy Create free account
hub / github.com/Kaggle/docker-python / setup

Method setup

tests/test_pytorch_lightning.py:18–25  ·  view source on GitHub ↗
(self, stage=None)

Source from the content-addressed store, hash-verified

16 self.batch_size = batch_size
17
18 def setup(self, stage=None):
19 X_train = torch.rand(100, 1, 28, 28)
20 y_train = torch.randint(0, 10, size=(100,))
21 X_valid = torch.rand(20, 1, 28, 28)
22 y_valid = torch.randint(0, 10, size=(20,))
23
24 self.train_ds = TensorDataset(X_train, y_train)
25 self.valid_ds = TensorDataset(X_valid, y_valid)
26
27 def train_dataloader(self):
28 return DataLoader(self.train_ds, batch_size=self.batch_size, shuffle=True, num_workers=1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected