Solved by Hmrishav_Bandyopadhy in post #5 
              
              
                Hi, 
You are actually using extracting CIFAR dataset as i mentioned in the previous answer. CIFAR dataset has 50,000 training images and 10,000 testing images. 
Use this for MNIST: 
import torchvision
from torch.utils.data import DataLoader, Dataset, TensorDataset
dl_train = DataLoader( torchvision.…