@ptrblck Thanks for your answer.
Before you answer my question, I have written a dataloader that l load all the data (images) create batches from that (not a tensor, just a simple RGB image), then for each batch, I will save the image name and the number of batches, so at the end, I can know which patch belongs to which image and what is the number. I do not know if it is a efficient way or not.
For your solution, when we have folders, you mean in Dataset, in __init__, I load all the folders which have batches?
Can you elaborate more? you mean I should have n dataloader which n is the number of images? and another thing is that for example for each image, I will create 1000 batches, then how can I put these 1000 patches into a batch_size of 32 and do not lose which patch belongs to which image?
Again, thanks for your time.