There is no interation between no_grad, enable_grad, set_grad_enabled #40158
Labels
high priority
module: autograd
Related to torch.autograd, and the autograd engine in general
module: docs
Related to our documentation, both in docs/ and docblocks
small
We think this is a small issue to fix. Consider knocking off high priority small issues
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃摎 Documentation
torch==1.5.0
The problem is the same for all three functions. For example, let's consider no_grad.
The documentation says: "This mode has no effect when using
enable_grad
context manager". This is not true:And I mean that the documentation should be fixed, not the behavior of
torch
馃槃These functions just set grad enabled/disabled in
__enter__
(or in the constructor in the case ofset_grad_enabled
) and set the previous state in__exit__
. This is very intuitive. IMHO, it will be confusing if, for example, the behavior ofno_grad
changes depending on some other context.cc @ezyang @gchanan @zou3519 @ssnl @albanD @gqchen @jlin27
The text was updated successfully, but these errors were encountered: