title: Display number of images per class using Pytorch
body: <p>I am using Pytorch with FashionMNIST dataset I would like to display 8 image sample from each of the 10 classes. However, I did not figure how to split the training test into train_labels since I need to loop on the labels(class) and print 8 of each class.
  any idea how I can achieve this?</p>
  <pre><code>classes = ('T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot')
  
  # Define a transform to normalize the data
  transform = transforms.Compose([transforms.ToTensor(),
                                #  transforms.Lambda(lambda x: x.repeat(3,1,1)),
                                  transforms.Normalize((0.5, ), (0.5,))])
  # Download and load the training data
  trainset = datasets.FashionMNIST('~/.pytorch/F_MNIST_data/', download=True, train=True, transform=transform)
  trainloader = torch.utils.data.DataLoader(trainset, batch_size=4, shuffle=True)
  # Download and load the test data
  testset = datasets.FashionMNIST('~/.pytorch/F_MNIST_data/', download=True, train=False, transform=transform)
  testloader = torch.utils.data.DataLoader(testset, batch_size=4, shuffle=True)
  
  
  print('Training set size:', len(trainset))
  print('Test set size:',len(testset))
  </code></pre>