Skip to content

Commit ed7e509

Browse files
docs: Update docstring to include link for extending torch.autograd
1 parent dfb4f9e commit ed7e509

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

beginner_source/examples_autograd/polynomial_custom_function.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def forward(ctx, input):
3535
a Tensor containing the output. ctx is a context object that can be used
3636
to stash information for backward computation. You can cache tensors for
3737
use in the backward pass using the ``ctx.save_for_backward`` method. Other
38-
objects can be stored directly as attributes on the ctx object, such as
39-
ctx.my_object = my_object.
38+
objects can be stored directly as attributes on the ctx object, such as
39+
ctx.my_object = my_object. Check out `Extending torch.autograd <https://docs.pytorch.org/docs/stable/notes/extending.html#extending-torch-autograd>`_
40+
for further details.
4041
"""
4142
ctx.save_for_backward(input)
4243
return 0.5 * (5 * input ** 3 - 3 * input)

0 commit comments

Comments
 (0)