pytorch/torch/csrc/jit/python
Elias Ellison f90dc741eb [JIT] Normalize op aliases (#38735)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38735

Follow up to my comment https://github.com/pytorch/pytorch/pull/36597/#issuecomment-613674329

This adds a pass to convert op aliases into a normalized form. Having two ops generated in our IR that do the same thing makes the IR harder for downstream consumers of the IR, such as TorchScript passes but also ONNX, glow, etc.

Another solution would have been to fix our code generation to only emit `aten::abs` from the start. This seems trickier, and doesn't really buy us much if we still have to expose `aten::absolute` in C++, as glaringlee of the C++ API thinks we should.

Bike shedding: maybe this should be `CanonicalizeOps` instead

Test Plan: Imported from OSS

Differential Revision: D21673108

Pulled By: eellison

fbshipit-source-id: c328618907de1af22e07f57fd27fa619978c2817
2020-05-21 21:47:17 -07:00
..
init.cpp [JIT] Normalize op aliases (#38735) 2020-05-21 21:47:17 -07:00
init.h
module_python.h [jit] kill script namespace (#34515) 2020-03-11 23:32:48 -07:00
pybind_utils.h [torchbind] Better error message when missing init. (#37474) 2020-05-13 17:38:31 -07:00
pybind.h [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00
python_arg_flatten.cpp [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00
python_arg_flatten.h
python_custom_class.cpp [torchbind] Better error message when missing init. (#37474) 2020-05-13 17:38:31 -07:00
python_custom_class.h
python_interpreter.cpp [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00
python_ir.cpp [quant] ConvPackedParams with TorchBind (#35923) 2020-05-05 20:18:36 -07:00
python_ir.h [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00
python_ivalue.h Explicitly decref py::object in ConcretePyObjectHolder and PythonFunctionGuard (#38364) 2020-05-12 20:55:53 -07:00
python_sugared_value.cpp [quant][graphmode] Different rule for add/add_/mul/mul_ (#38667) 2020-05-20 19:43:46 -07:00
python_sugared_value.h [JIT] Refactor attributes to support buffers and parameters as first class citizens, add support for iterating over named_buffers() (#37905) 2020-05-18 23:23:43 -07:00
python_tracer.cpp [jit] tracer flag to guard risky behaivors (#36277) 2020-04-13 22:35:03 -07:00
python_tracer.h [jit] tracer flag to guard risky behaivors (#36277) 2020-04-13 22:35:03 -07:00
python_tree_views.cpp [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00
python_tree_views.h [jit] kill script namespace (#34515) 2020-03-11 23:32:48 -07:00
script_init.cpp [JIT] Normalize op aliases (#38735) 2020-05-21 21:47:17 -07:00
script_init.h [jit] kill script namespace (#34515) 2020-03-11 23:32:48 -07:00
update_graph_executor_opt.cpp Canonicalize includes in torch, and add tests for it (#36303) 2020-04-23 08:09:21 -07:00
update_graph_executor_opt.h [JIT] clang-format JIT code (#35115) 2020-03-26 11:24:51 -07:00