The Subset tries to index the dataset, which doesn’t work for IterableDatasets:
test_dataset = TestDataset()
test_dataset[0]
> NotImplementedError

Since you already seem to define a__len__ method I would suggest to use the map-style torch.utils.data.Dataset and define the __getitem__ method, which would work using random_split.