pytorch/tools/codegen
Sebastian Messmer 6ba6ecb048 Only use hacky_wrapper_for_legacy_signatures if an op needs it (#45742)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45742

Add a new flag to native_functions.yaml: `use_c10_dispatcher: hacky_wrapper_for_legacy_signatures`
and the codegen only wraps kernels in the aforementioned wrapper if that flag is set.
Apart from that, `use_c10_dispatcher: hacky_wrapper_for_legacy_signatures` is equivalent to `full`,
i.e. it has full boxing and unboxing support.

This greatly reduces the number of ops we apply the hacky_wrapper to, i.e. all ops marked as `use_c10_dispatcher: full` don't have it anymore.
ghstack-source-id: 113982139

Test Plan:
waitforsandcastle

vs fbcode:
https://www.internalfb.com/intern/fblearner/details/214511705/

vs base diff:
https://www.internalfb.com/intern/fblearner/details/214693207/

Reviewed By: ezyang

Differential Revision: D23328718

fbshipit-source-id: be120579477b3a05f26ca5f75025bfac37617620
2020-10-12 09:39:18 -07:00
..
api Only use hacky_wrapper_for_legacy_signatures if an op needs it (#45742) 2020-10-12 09:39:18 -07:00
__init__.py
code_template.py
gen.py Only use hacky_wrapper_for_legacy_signatures if an op needs it (#45742) 2020-10-12 09:39:18 -07:00
local.py Byte-for-byte compatibility fixes in codegen (#44879) 2020-09-25 08:06:50 -07:00
model.py Only use hacky_wrapper_for_legacy_signatures if an op needs it (#45742) 2020-10-12 09:39:18 -07:00