title: How does `images, labels = dataiter.next() ` work in PyTorch Tutorial?
body: <p>From the tutorial <a href="https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html" rel="noreferrer">cifar10_tutorial</a>, how is <code>images, labels</code> assigned?</p>
  
  <pre><code>trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
                                          download=True, transform=transform)
  trainloader = torch.utils.data.DataLoader(trainset, batch_size=4,
                                            shuffle=True, num_workers=2)
  
  def imshow(img):
      img = img / 2 + 0.5     # unnormalize
      npimg = img.numpy()
      plt.imshow(np.transpose(npimg, (1, 2, 0)))
  
  
  # get some random training images
  dataiter = iter(trainloader)
  
  images, labels = dataiter.next()
  </code></pre>
  
  <p>How does the last line know how to automatically assign <code>images, label</code> in <code>images, labels = dataiter.next()</code>?</p>
  
  <p>I checked the <code>DataLoader</code> class and the <code>DataLoaderIter</code> class, but think I need a bit more knowledge of iters in general.</p>