pytorch
41f8641f - Delete SchemaRegister.cpp, make flag operate on TypeDefault.cpp (#46991)

Commit
4 years ago
Delete SchemaRegister.cpp, make flag operate on TypeDefault.cpp (#46991) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/46991 This change is motivated by a problem bdhirsh observed which is that in internal builds that include both SchemaRegister.cpp and TypeDefault.cpp, some operators have their schemas defined multiple times. Instead of dumping schema registrations in multiple files, it seems better to just toggle how many schemas we write into TypeDefault.cpp. ljk53 observes that technically SchemaRegister.cpp is only needed by full-JIT frontend, and not by light interpreter (to resolve schema lookups). However, in practice, the registration file seems to be unconditionally loaded. This change will make it harder to do the optimization where we drop schemas in the light interpreter, but you probably want to architect this differently (similar to per-op registrations, DON'T do any registrations in ATen, and then write out the schema registrations in a separate library.) I took this opportunity to also simplify the TypeDefault generation logic by reworking things so that we only ever call with None argument when registering. Soon, we should be able to just split these files up entirely. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Reviewed By: ljk53 Differential Revision: D24593704 Pulled By: ezyang fbshipit-source-id: f01ea22a3999493da77b6e254d188da0ce9adf2f
Author
Parents
Loading