Improve custom function docs (#60312)
authorsoulitzer <soulitzer@gmail.com>
Wed, 18 Aug 2021 18:29:51 +0000 (11:29 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 18 Aug 2021 18:31:31 +0000 (11:31 -0700)
commit2f615f63135e834499b5d11a4fbced91d70913cc
tree23711b33d53d601aa7cd36d03fb23c9ffb139671
parentd565a7bd6871b39b2aee978f6fd1c15fb290c3ca
Improve custom function docs (#60312)

Summary:
- Adds some code examples for `ctx` methods and make requirements of arguments more clear
- Type annotations for `save_for_backward`, `mark_dirty`, `mark_non_differentiable`, and `set_materialize_grads` (BC-breaking?)
- Refactor `torch.autograd.Function` doc

Pull Request resolved: https://github.com/pytorch/pytorch/pull/60312

Reviewed By: VitalyFedyunin

Differential Revision: D30314961

Pulled By: soulitzer

fbshipit-source-id: a284314b65662e26390417bd2b6b12cd85e68dc8
docs/source/autograd.rst
docs/source/notes/extending.rst
torch/autograd/function.py