update nn.init doc to reflect the no_grad (#80882)

Fixes https://github.com/pytorch/pytorch/issues/80839

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80882
Approved by: https://github.com/jbschlosser
This commit is contained in:
albanD
2022-07-07 17:19:29 +00:00
committed by PyTorch MergeBot
parent bd75b2fea1
commit 6f1d99b79f

View File

@ -6,6 +6,11 @@
torch.nn.init torch.nn.init
============= =============
.. warning::
All the functions in this module are intended to be used to initialize neural network
parameters, so they all run in :func:`torch.no_grad` mode and will not be taken into
account by autograd.
.. currentmodule:: torch.nn.init .. currentmodule:: torch.nn.init
.. autofunction:: calculate_gain .. autofunction:: calculate_gain
.. autofunction:: uniform_ .. autofunction:: uniform_