title: How to get a Pytorch data loader per class?
body: <p>I want to train my model on 1 MNIST class at a time.</p>
  <p>I can load the data with a general loader:</p>
  <pre><code>import torch
  import torch.nn as nn
  import torch.optim as optim
  import torchvision.datasets as datasets
  import torchvision.transforms as transforms
  from torch.autograd import Variable
  
  
  trans = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (1.0,))])
  # if not exist, download mnist dataset
  root = './data'
  train_set = datasets.MNIST(root=root, train=True, transform=trans, download=True)
  
  batch_size = 100
  
  train_loader = torch.utils.data.DataLoader(
                   dataset=train_set,
                   batch_size=batch_size,
                   shuffle=True)
  </code></pre>
  <p>But I'm not sure how to create 10 loaders (1 for each of the classes/digits) from this general loader (or just 10 loaders initially)</p>