I want to implement denoising autoencoder in pytorch.
when I am in the training loop:
for inputs,labels in trainloader:
        noised_inputs=add_noise(inputs)
        opt.zero_grad()
        outputs = net(noised_inputs)
        loss = loss_fn(outputs,inputs)
        loss.backward()
        opt.step()

Please tell me how to implement this add_noise function which can add gaussian noise to the entire batch input of images