@@ -645,11 +645,11 @@ def register_load_state_dict_pre_hook(
645
645
hook : Callable [["Optimizer" , StateDict ], Optional [StateDict ]],
646
646
prepend : bool = False ,
647
647
) -> RemovableHandle :
648
- r"""Register a state dict pre-hook which will be called before
649
- :meth:`~torch.optim.Optimizer.state_dict ` is called. It should have the
648
+ r"""Register a load_state_dict pre-hook which will be called before
649
+ :meth:`~torch.optim.Optimizer.load_state_dict ` is called. It should have the
650
650
following signature::
651
651
652
- hook(optimizer) -> None
652
+ hook(optimizer, state_dict ) -> state_dict or None
653
653
654
654
The ``optimizer`` argument is the optimizer instance being used and the
655
655
``state_dict`` argument is a shallow copy of the ``state_dict`` the user
@@ -683,11 +683,11 @@ def register_load_state_dict_pre_hook(
683
683
def register_load_state_dict_post_hook (
684
684
self , hook : Callable [["Optimizer" ], None ], prepend : bool = False
685
685
) -> RemovableHandle :
686
- r"""Register a state dict post-hook which will be called after
687
- :meth:`~torch.optim.Optimizer.state_dict ` is called. It should have the
686
+ r"""Register a load_state_dict post-hook which will be called after
687
+ :meth:`~torch.optim.Optimizer.load_state_dict ` is called. It should have the
688
688
following signature::
689
689
690
- hook(optimizer, state_dict ) -> state_dict or None
690
+ hook(optimizer) -> None
691
691
692
692
The ``optimizer`` argument is the optimizer instance being used.
693
693
0 commit comments