You are replacing the original adv_x leaf tensor:
x = torch.randn(1)
adv_x = x.clone().detach().float().requires_grad_(True)
print(adv_x.requires_grad)
> True
print(adv_x.is_leaf)
> True

here:
eps = 1e-6
rand = torch.zeros_like(x).uniform_(-eps, eps).float()
adv_x = adv_x + rand
x_min, x_max = -1, 1
adv_x = torch.clamp(adv_x, x_min, x_max)
print(adv_x.requires_grad)
> True
print(adv_x.is_leaf)
> False

If you are trying to access the .grad attribute of adv_x, you will also get a warning which explains the returned None value:
y = adv_x * 2
y.backward()
print(adv_x.grad)
> None
UserWarning: The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. Its .grad attribute won't be populated during autograd.backward(). If you indeed want the gradient for a non-leaf Tensor, use .retain_grad() on the non-leaf Tensor. If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. See github.com/pytorch/pytorch/pull/30531 for more information.