I am using torchvision.transforms.Lambda to apply noise to each input in my dataset:
torchvision.transforms.Lambda(lambda x: x + torch.rand(x.shape))

The problem is that each time a particular image is sampled, the noise that is added is different. I would like to apply the noise up front (not during training) so that every time I sample a particular image the noise is the same.
Thanks!