doc fix nn.Module: docstring should come after class variable (#72912)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/72862

Pull Request resolved: https://github.com/pytorch/pytorch/pull/72912

Reviewed By: cpuhrsch

Differential Revision: D34286017

Pulled By: jbschlosser

fbshipit-source-id: d172f7600e7f66c30187996ee42c72bf273643cc
(cherry picked from commit d9f9b5b418)
This commit is contained in:
lkct 2022-02-16 15:02:21 -08:00 committed by PyTorch MergeBot
parent bbac8c9c48
commit 352eeb2ef9

View File

@ -237,6 +237,7 @@ class Module:
dump_patches: bool = False
_version: int = 1
r"""This allows better BC support for :meth:`load_state_dict`. In
:meth:`state_dict`, the version number will be saved as in the attribute
`_metadata` of the returned state dict, and thus pickled. `_metadata` is a
@ -247,7 +248,6 @@ class Module:
be bumped, and the module's `_load_from_state_dict` method can compare the
version number and do appropriate changes if the state dict is from before
the change."""
_version: int = 1
training: bool
_is_full_backward_hook: Optional[bool]