Skip to content

Commit 35991df

Browse files
olokshynpytorchmergebot
authored andcommitted
fix(docs): torch.autograd.graph.Node.register_hook can override grad_inputs, not grad_outputs (pytorch#100272)
Fixes pytorch#99165 Pull Request resolved: pytorch#100272 Approved by: https://github.com/soulitzer
1 parent 2b79d6c commit 35991df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/autograd/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def register_hook(self, fn: Callable[..., Any]) -> RemovableHandle:
5858
5959
6060
The hook should not modify its argument, but it can optionally return
61-
a new gradient which will be used in place of :attr:`grad_outputs`.
61+
a new gradient which will be used in place of :attr:`grad_inputs`.
6262
6363
This function returns a handle with a method ``handle.remove()``
6464
that removes the hook from the module.

0 commit comments

Comments
 (0)