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

Function prepare_dataloader

distributed/ddp-tutorial-series/multinode.py:85–92  ·  view source on GitHub ↗
(dataset: Dataset, batch_size: int)

Source from the content-addressed store, hash-verified

83
84
85def prepare_dataloader(dataset: Dataset, batch_size: int):
86 return DataLoader(
87 dataset,
88 batch_size=batch_size,
89 pin_memory=True,
90 shuffle=False,
91 sampler=DistributedSampler(dataset)
92 )
93
94
95def main(save_every: int, total_epochs: int, batch_size: int, snapshot_path: str = "snapshot.pt"):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected