This approach should work, if your optimizer doesn’t have internal states, which is the case for SGD.
However, you also should be able to wrap the clamp operation into a torch.no_grad() block instead of applying it on a cloned tensor:
with torch.no_grad():
    adv_image.clamp_(-1, 1)