there is no chage to the dataset even after random affine (pytorch)
I downloaded two version of mnist dataset: one without any transformation, one with random affinement and normalization.
w/o transformation code:
mnist_train = torchvision.datasets.MNIST(root='MNIST_data/', 
                          train=True, 
                          transform=transforms.ToTensor(), 
                          download=True)

with transformation code:
train_transforms = transforms.Compose(
    [transforms.RandomAffine(degrees=30),
     transforms.ToTensor(),
     transforms.Normalize(mean=(0.5,), std=(0.5,))])

augmented_data = torchvision.datasets.MNIST(root='aug_data/',
                                        train=True,
                                        transform=train_transforms,
                                        download=True)

I printed several samples from those two, but the results were all identical.
can anybody figure out the cause??
thank you

There is no augmented MNIST dataset and download=True just downloads the same plain MNIST dataset in the roots you have specified.
The transform is applied online when you access an element of the dataset, e.g. augmented_data[0]. In this way, the transformation you have specified is applied to the first image of MNIST.
If you want to check the difference you, therefore, have to display the images accessed in this way with some visualization tool, e.g. by using matplotlib.imshow:
Code
import torch
import torchvision
from torchvision import transforms
import matplotlib.pyplot as plt

mnist_train = torchvision.datasets.MNIST(root='MNIST_data/', 
                          train=True, 
                          transform=transforms.ToTensor(), 
                          download=True)

train_transforms = transforms.Compose(
    [transforms.RandomAffine(degrees=30),
     transforms.ToTensor(),
     transforms.Normalize(mean=(0.5,), std=(0.5,))])

# you can use the same root, since the data is the same
augmented_data = torchvision.datasets.MNIST(root='MNIST_data/',  
                                        train=True,
                                        transform=train_transforms,
                                        download=True)

im = mnist_train[0][0][0]
aug_im = augmented_data[0][0][0]

# Normal image
plt.imshow(im, cmap=&quot;gray&quot;)
plt.colorbar()
plt.show()

# Agumented image
plt.imshow(aug_im, cmap=&quot;gray&quot;)
plt.colorbar()
plt.show()

Result
Normal Image

Augmented Image

Note the difference of value ranges in the right-sided color bar.
