(opt)
| 39 | |
| 40 | |
| 41 | def 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 |
nothing calls this directly
no test coverage detected