MCPcopy Create free account
hub / github.com/pytorch/examples / load_train_objs

Function load_train_objs

distributed/ddp-tutorial-series/multigpu_torchrun.py:77–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75
76
77def load_train_objs():
78 train_set = MyTrainDataset(2048) # load your dataset
79 model = torch.nn.Linear(20, 1) # load your model
80 optimizer = torch.optim.SGD(model.parameters(), lr=1e-3)
81 return train_set, model, optimizer
82
83
84def prepare_dataloader(dataset: Dataset, batch_size: int):

Callers 1

mainFunction · 0.70

Calls 1

MyTrainDatasetClass · 0.90

Tested by

no test coverage detected