[easy] Small rendering fix in Tensor.module_load doc (#130489)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/130489
Approved by: https://github.com/janeyx99
This commit is contained in:
Mikayla Gawarecki
2024-07-10 14:26:29 -07:00
committed by PyTorch MergeBot
parent 95046c86e3
commit 619029e892

View File

@ -722,7 +722,7 @@ class Tensor(torch._C.TensorBase):
It is expected that ``self`` is a parameter or buffer in an ``nn.Module`` and ``other`` is the
value in the state dictionary with the corresponding key, this method defines
how ``other`` is remapped before being swapped with ``self`` via
:func:`~torch.utils.swap_tensors`` in ``module.load_state_dict()``.
:func:`~torch.utils.swap_tensors` in :meth:`~nn.Module.load_state_dict`.
.. note::
This method should always return a new object that is not ``self`` or ``other``.