pytorch/tools/codegen/api
Ivan Yashchuk 53c0d91db9 Make autograd codegen for differentiable outputs safer to use (#65823)
Summary:
This PR adds raising an error when `len(output_differentiability) != len(outputs)`

Notes in derivatives.yml tell that
> 'output_differentiability' and value a list of the same length as the number of outputs from the forward function.

but it was not enforced in codegen leading to confusion and unexpected bugs https://github.com/pytorch/pytorch/issues/65061#issuecomment-930271126.

cc ezyang albanD zou3519 gqchen pearu nikitaved soulitzer Lezcano Varal7

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

Reviewed By: mrshenli

Differential Revision: D31307312

Pulled By: albanD

fbshipit-source-id: caeb949e9249310dffd237e77871e6d0d784e298
2021-10-01 07:27:57 -07:00
..
__init__.py Rewrite of ATen code generator (#42629) 2020-08-31 09:00:22 -07:00
autograd.py Make autograd codegen for differentiable outputs safer to use (#65823) 2021-10-01 07:27:57 -07:00
cpp.py Reland of "D27708346: generate xla codegen in-tree" (#56601) 2021-04-21 19:36:31 -07:00
dispatcher.py Reland of "D27708346: generate xla codegen in-tree" (#56601) 2021-04-21 19:36:31 -07:00
meta.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
native.py [PyTorch] Fix const correctness for resize native functions (#55351) 2021-04-21 14:51:41 -07:00
python.py Add an optional Device parameter to pin_memory/is_pinned that does nothing (#60201) 2021-06-28 10:38:52 -07:00
structured.py [structured] Preserve computed elements from meta func to impl (#61746) 2021-09-01 14:34:25 -07:00
translate.py clamp: port to structured kernel (#61361) 2021-07-23 02:02:07 -07:00
types.py clamp: port to structured kernel (#61361) 2021-07-23 02:02:07 -07:00