Loading .npy files as dataset for pytorch
I have preprocessed data in .npy files, let's call it X.npy for raw data and Y.npy for labels. They're organized to match every element from both files (first element from X has first label from Y etc.). How can I load it as dataset using torch.utils.data.DataLoader? I'm very new to pytorch, and any help will be useful.

You could also use DatasetFolder, which basically is the underlying class of ImageFolder. Using this class you can provide your own file extensions and loader to load the samples.

def npy_loader(path):
    return torch.from_numpy(np.load(path))

