title: I don't understand the code for training a classifier in pytorch
body: <p>I don't understand the line <code>labels.size(0)</code>. I'm new to Pytorch and been quite confused about the data structure.</p>
  
  <pre><code>correct = 0
  total = 0
  with torch.no_grad():
     for data in testloader:
        images, labels = data
        outputs = net(images)
        _, predicted = torch.max(outputs.data, 1)
        total += labels.size(0)
        correct += (predicted == labels).sum().item()
  
  print('Accuracy of the network on the 10000 test images: %d %%' % (
      100 * correct / total))`
  </code></pre>