I’m not sure about deleting the sample from the dataset but did you try checking for the condition as you fetch the batches?
I think it is possible to remove/modify the batches fetched from dataloader in general.