In the tutorial,how to set the number of training and test sets?

In the tutorial,CIFAR10 dataset,Why training data has 50000,testing data has 10000.We did not set the amount of training data and test data.

This is code:

transform = transforms.Compose(
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])

trainset = torchvision.datasets.CIFAR10(root=‘F:\OfficialData’, train=True,
download=True, transform=transform)
trainloader =, batch_size=4,
shuffle=True, num_workers=0)

testset = torchvision.datasets.CIFAR10(root=‘F:\OfficialData’, train=False,
download=True, transform=transform)
testloader =, batch_size=4,
shuffle=False, num_workers=0)

classes = (‘plane’, ‘car’, ‘bird’, ‘cat’,
‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’)

Why didnt we specify their size? because they are the defaults. if you want you can alter it in any way and shape you like.
checkout for more information.
(quick tip, you may want to use to form different sets as you like.