It seems you are replacing self.log_alpha in your example.
Have a look at these example, where we 1) replace x, 2) assign to a new tensor and 3) modify x inplace:
# 1) replace tensor
x = torch.randn(2, requires_grad=True)
loss = torch.mean(x)
loss.backward()
print(x.grad)
> tensor([0.5000, 0.5000])
grad = x.grad
x = x - grad
print(x.grad)
> None

# 2) assign to other tensor
x = torch.randn(2, requires_grad=True)
loss = torch.mean(x)
loss.backward()
print(x.grad)
> tensor([0.5000, 0.5000])
grad = x.grad
y = x - grad
print(x.grad)
> tensor([0.5000, 0.5000])
print(y.grad)
> None

# 3) inplace
x = torch.randn(2, requires_grad=True)
loss = torch.mean(x)
loss.backward()
print(x.grad)
> tensor([0.5000, 0.5000])
grad = x.grad
with torch.no_grad():
    x.sub_(grad)
print(x.grad)
> tensor([0.5000, 0.5000])