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

Function prepare_dataloader

distributed/ddp-tutorial-series/multigpu.py:76–83  ·  view source on GitHub ↗
(dataset: Dataset, batch_size: int)

Source from the content-addressed store, hash-verified

74
75
76def prepare_dataloader(dataset: Dataset, batch_size: int):
77 return DataLoader(
78 dataset,
79 batch_size=batch_size,
80 pin_memory=True,
81 shuffle=False,
82 sampler=DistributedSampler(dataset)
83 )
84
85
86def main(rank: int, world_size: int, save_every: int, total_epochs: int, batch_size: int):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected