Change phrasing on optim state hook docs (#106209)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/106209
Approved by: https://github.com/albanD
This commit is contained in:
Jane Xu 2023-07-28 08:58:05 -07:00 committed by PyTorch MergeBot
parent 800287fb56
commit ad3af0aead

View File

@ -464,7 +464,7 @@ class Optimizer:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the already registered pre-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the existing registered
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
@ -498,8 +498,8 @@ class Optimizer:
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the existing registered post-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the existing registered
all the already registered post-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns:
@ -653,9 +653,9 @@ class Optimizer:
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the existing registered pre-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the pre-hooks registered
before. (default: False)
all the already registered pre-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
@ -688,8 +688,8 @@ class Optimizer:
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the existing registered post-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the existing registered
all the already registered post-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns: