I  am  not sure about your issues.
then, I hold the view  that: if  the data_loader is 100 (constant),  and I set the batch_size = 20; I will know one iteration can fetch 20 data from data_loader, training all data  needs 100/20=5 iterations.