MCPcopy Create free account
hub / github.com/pytorch/executorch / get_data_loader

Function get_data_loader

examples/qualcomm/utils.py:180–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 from torchvision import datasets, transforms
179
180 def get_data_loader():
181 preprocess = transforms.Compose(
182 [
183 transforms.Resize(image_shape),
184 transforms.CenterCrop(crop_size or image_shape[0]),
185 transforms.ToTensor(),
186 transforms.Normalize(
187 mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
188 ),
189 ]
190 )
191 imagenet_data = datasets.ImageFolder(dataset_path, transform=preprocess)
192 return torch.utils.data.DataLoader(
193 imagenet_data,
194 shuffle=shuffle,
195 )
196
197 # prepare input data
198 inputs, targets = [], []

Calls 2

SquadSeq2SeqDatasetClass · 0.85

Tested by

no test coverage detected