Solved by ptrblck in post #2 
              
              
                You are creating a non-leaf tensor with the torch.clamp operation: 
created_image = torch.normal(mean=1, std=1, size=(1,1,28,28), requires_grad=True)
print(created_image.is_leaf)
> True
created_image = torch.clamp(created_image, -1, 1)
print(created_image.is_leaf)
> False

Try to change the output o…