Refactor structured set_output in Register{DispatchKey}.cpp (#62188)
authorPeter Bell <peterbell10@live.co.uk>
Fri, 27 Aug 2021 16:37:10 +0000 (09:37 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 27 Aug 2021 16:38:27 +0000 (09:38 -0700)
commita9983ac09c9772fa426224b080090083b4c9607b
tree6327ef51d9952c75ef5ac876b7f54d309f8235cf
parentf922b58b5fe420538f35d4c88953b664be85d7ee
Refactor structured set_output in Register{DispatchKey}.cpp (#62188)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62188

These parts of the `set_output` code are identical for all operators in the
kernel registration files. So, this moves them from being copied into every
class to two helper functions at the top of the file.

Test Plan: Imported from OSS

Reviewed By: soulitzer

Differential Revision: D29962045

Pulled By: albanD

fbshipit-source-id: 753b8aac755f3c91b77ffa2c30a89ac91a84b7c4
aten/src/ATen/templates/RegisterDispatchKey.cpp
tools/codegen/dest/__init__.py
tools/codegen/dest/register_dispatch_key.py
tools/codegen/gen.py
tools/codegen/gen_backend_stubs.py