We also landed a new PR that allows subclasses of IterableDataset to be used in DataLoader with Python 3.10. If you download the nightly version of PyTorch from the middle of this page 27, it should work.