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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected