How to efficiently updata DataLoader?

Hi, recently I am studying semi-supervised learning. If unlabeled data gets a pseudo-label with High confidence from a pre-trained model, I want to add the (unlabeled data, pseudo-label) into the train_loader for further training the model. How to add these data into the train_loader and load it efficiently? (Pytorch)

if unlabeled data gets a pseudo-label with high confidence, isn’t that you loaded the sample already? or perhaps you mean you have 2 different dataloaders and want to register this (data, pseudo_label)? in that case you want the second one to be some IterableDataset that is fed from a continuously re-written csv file i guess (I do not think map-style would handle variable-length dataset)