Let me confirm that your objective is to get a dataset that contains both training and testing set of CIFAR-10?
Train = datasets.CIFAR10(root='~/data', train=True,download=True,transform=transform_train)
Test = datasets.CIFAR10(root='~/data', train=False,download=False,transform=transform_test)
new_set = torch.utils.data.ConcatDataset([Train, Test])
loader = torch.utils.data.DataLoader(new_set,batch_size=64,shuffle=True, num_workers=8)
for inputs, targets in loader:
    #do something

The (inputs, tagets) pair will be from either the training set or the testing set.
It’s like having a huge dataset containing both training and testing data