pytorch/tools/codegen
Edward Yang 2f222fc88c Mild refactor of native_functions.yaml dispatch parsing (#66109)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66109

This refactor is no longer necessary for ufunc codegen, as I changed
the format of ufuncs to not directly be inserted into the 'dispatch'
key, but I think the refactored code here is better.  The basic concept
is to directly construct BackendMetadata as we are parsing entries of
the dispatch dictionary, rather than post facto creating them later.
This centralizes the compute and means that the creation of the backend index
is just a simple reindexing by operator name (nothing nontrivial).

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Test Plan: Imported from OSS

Reviewed By: bdhirsh

Differential Revision: D31385760

Pulled By: ezyang

fbshipit-source-id: 4fcb491ba025d2aa6fd356586b57affb97a507fc
(cherry picked from commit 21c93d4199)
2022-02-17 02:01:36 +00:00
..
api Revert D34178476: Update lazy_ir.py from lazy_tensor_staging 2022-02-16 19:34:41 +00:00
dest Revert D34178476: Update lazy_ir.py from lazy_tensor_staging 2022-02-16 19:34:41 +00:00
operator_versions Fix upgrader codegen when constant list is 0 (#72199) 2022-02-03 00:41:03 +00:00
selective_build [Pytorch Edge] Generic Build Features for Selective Build (#67817) 2021-11-09 15:37:21 -08:00
__init__.py Rewrite of ATen code generator (#42629) 2020-08-31 09:00:22 -07:00
code_template.py Rewrite of ATen code generator (#42629) 2020-08-31 09:00:22 -07:00
context.py avoid error string formatting aten codegen 28s -> 23s (#59848) 2021-06-12 06:58:31 -07:00
gen_backend_stubs.py codegen: do not generate code for dispatch_namespaced_definitions (#69074) 2022-02-16 19:30:38 +00:00
gen_functionalization_type.py Functionalization: Only include headers for required ops (#68690) 2021-12-15 14:29:35 -08:00
gen_lazy_tensor.py Revert D34178476: Update lazy_ir.py from lazy_tensor_staging 2022-02-16 19:34:41 +00:00
gen.py fix minor issues for ATen/ROCm (#71925) 2022-02-09 19:11:01 +00:00
local.py [PyTorch] Fix const correctness for resize native functions (#55351) 2021-04-21 14:51:41 -07:00
model.py Mild refactor of native_functions.yaml dispatch parsing (#66109) 2022-02-17 02:01:36 +00:00
utils.py Codegen: Do less work in dry-runs for sharded files (#69805) 2022-02-02 19:25:16 +00:00