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

Function prepare_dataloader

distributed/ddp-tutorial-series/multigpu_torchrun.py:84–91  ·  view source on GitHub ↗
(dataset: Dataset, batch_size: int)

Source from the content-addressed store, hash-verified

82
83
84def prepare_dataloader(dataset: Dataset, batch_size: int):
85 return DataLoader(
86 dataset,
87 batch_size=batch_size,
88 pin_memory=True,
89 shuffle=False,
90 sampler=DistributedSampler(dataset)
91 )
92
93
94def 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