pytorch
68cb06c7 - Make gen_annotated_args support kwargs (#98396)

Commit
1 year ago
Make gen_annotated_args support kwargs (#98396) This PR is to address the issue seeing in PR #97417 where the newly added op requires `kwargs`, however, currently tools/autograd/gen_annotated_fn_args.py does not support `kwargs`, only `func_args` are generated for test_overrides.py. The PR adds a new field "is_kwargs" to each argument indicating whether it's a `kwargs` or not. See example: ``` annotated_args = { torch._C._VariableFunctions._cast_Byte: [{'is_kwarg_only': 'False', 'name': 'self', 'simple_type': 'Tensor'}], ... ``` The full comparison of the generated file `annotated_fn_args.py` can be found here: - **Before**: [P681991116](https://www.internalfb.com/phabricator/paste/view/P681991116) - **After**: [P681994218](https://www.internalfb.com/intern/paste/P681994218/) Differential Revision: D44698310 Pull Request resolved: https://github.com/pytorch/pytorch/pull/98396 Approved by: https://github.com/ezyang
Author
Committer
Parents
Loading