The method get_params_grad pot 0.0 when params.grad is None, but it should be torch.tensor(0.0), because when it will be called the torch method torch.autograd.grad it will raise an error, because a float does not have `.is_nested' method defined.
Let me know if you are facing the same problem.