Thank you.
check the error on the last line code
print(torch.max(data_new[0]-tr_data[0])) while applying same transformations both datasets class(MyDataset and datasets.MNIST). It should come to zero value but I am getting tensor(0.9961)