text_plain_output_2.png text_plain_output_1.png
import torchvision

import torchvision.transforms as transforms

train_transformer = transforms.Compose([transforms.RandomCrop(32, padding=5), transforms.RandomHorizontalFlip(p=0.5), transforms.RandomRotation(degrees=20), transforms.ToTensor()])
test_transformer = transforms.Compose([transforms.ToTensor()])

train_dataset = torchvision.datasets.CIFAR10(root='.', train=True, transform=train_transformer, download=True)
test_dataset = torchvision.datasets.CIFAR10(root='.', train=False, transform=test_transformer, download=True)