Thanks. Simple for loop can make my training code simpler. I my case I rewrote the code like this:
for epoch in range(num_epochs):
    for mb,yt in dl:                 
        if(mb.size(0)!=bs):
            print("...next epoch...")
            continue
         # training code

I learned I do not need necessary to use iter and next.
One epoch is to run trough all the samples. and this was a problem in my original code.
Thanks.