def __setstate__(self, state):
    super().__setstate__(state)
    for group in self.param_groups:
        group.setdefault('nesterov', False)
def __setstate__(self, state):
    super().__setstate__(state)
    for group in self.param_groups:
        group.setdefault('nesterov', False)