If you want to create patches from different inputs, you should increase the batch size and don’t repeat the sample['id'] in ToPatches().
Note that the _getitem__ method will get an index for each sample in the batch.
Given your desired output it seems you want to use batch_size=4 and shuffle=True in the DataLoader.