The master branch of torchvision should have this fixed as per #211 there 22. If you look at the len() function it used to return a hardcoded 50,000, but now it returns the actual size of the train data. If you can’t get master for some reason you can do what I do and just subclass like so:
class CIFAR10(dset.CIFAR10):
    def __len__(self):
        if self.train:
            return len(self.train_data)
        else:
            return len(self.test_data)