Dataloader iter() behaves like any other iterator in python. It raises StopIteration exception when the end is reached.
In pytorch tutorial, after loading the data 229, iter() followed by next() is used just to get some images and display them in the notebook. In the training loop 353, a for loop ()  is used to loop over the training data.