next(data loader. __iter__()) 

Creates a new iterator starting at the beginning of the dataset every time you call it.
# create dataloader-iterator
data_iter = iter(data_loader) 

# iterate over dataset
# alternatively you could use while(True) 
for i in range(NUM_ITERS_YOU_WANT)
    try:
        data = next(data_iter) 
    except StopIteration:
        # StopIteration is thrown if dataset ends
        # reinitialize data loader 
        data_iter = iter(data_loader)
        data = next(data_iter) 

Could do the trick (I did not test the code, just typed it here)