MCPcopy Create free account
hub / github.com/NVlabs/SPADE / create_dataloader

Function create_dataloader

data/__init__.py:41–54  ·  view source on GitHub ↗
(opt)

Source from the content-addressed store, hash-verified

39
40
41def create_dataloader(opt):
42 dataset = find_dataset_using_name(opt.dataset_mode)
43 instance = dataset()
44 instance.initialize(opt)
45 print("dataset [%s] of size %d was created" %
46 (type(instance).__name__, len(instance)))
47 dataloader = torch.utils.data.DataLoader(
48 instance,
49 batch_size=opt.batchSize,
50 shuffle=not opt.serial_batches,
51 num_workers=int(opt.nThreads),
52 drop_last=opt.isTrain
53 )
54 return dataloader

Callers

nothing calls this directly

Calls 2

find_dataset_using_nameFunction · 0.85
initializeMethod · 0.45

Tested by

no test coverage detected