.state()
Return the full optimizer state, including hyperparameters and moment estimates.
The returned dict contains enough information to resume training from
an exact checkpoint. Moment arrays are nested inside each group entry
so the structure mirrors param_groups.
Returns:
-
dict–Dict with
step_countand aparam_groupslist. Each group -
dict–entry contains its
label, hyperparameters (lr,beta_1, -
dict–beta_2,eps), andmoments1/moments2dicts mapping -
dict–parameter names to their current first and second moment arrays.