Which class should I use for a dataset without length?

I have a virtually unlimited data source for my dataset, i.e. the data source takes care of combining existing data to create samples and there is thus an extremely large number of possible samples due to combinatorial explosion. Therefore, I cannot inherit from torch.utils.data.Dataset to create my dataset as I have no value to provide for the length parameter. What should I use to still benefit from parallel data loading?

Judging by this post, you just need to give a huge number in the __len__ method.