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

Function get_data_loader

examples/samsung/scripts/vit.py:34–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 shuffle = True
33
34 def get_data_loader():
35 preprocess = transforms.Compose(
36 [
37 transforms.Resize(image_shape),
38 transforms.CenterCrop(crop_size),
39 transforms.ToTensor(),
40 transforms.Normalize(
41 mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
42 ),
43 ]
44 )
45 imagenet_data = datasets.ImageFolder(dataset_path, transform=preprocess)
46 return torch.utils.data.DataLoader(
47 imagenet_data,
48 shuffle=shuffle,
49 )
50
51 # prepare input data
52 inputs, targets, input_list = [], [], ""

Callers 1

get_datasetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected