Hi,
What is the error you’re seeing?
Also you should not use .data and Variables anymore.
You can replace noise=Variable(torch.tensor(img), requires_grad=True) by noise=torch.tensor(img, requires_grad=True) for example.