Load data in chunks using Dataset - PyTorch Forums
discuss.pytorch.org › t › load-data-in-chunks-usingJun 03, 2021 · I am wondering if I can modify __get_item__ in Dataset to accept multiple indices instead of one index at a time to improve data loading speed from disk using H5 file. My dataset looks something like this class HDFDataset(Dataset): def __init__(self, path): self.path = path def __len__(self): return self.len def __getitem__(self, idx): hdf = h5py.File(path, 'r') data = hdf['data'] X = data[idx ...