Refactor functionality and backend keys to reduce duplication (#81752)
Define some macros for stamping these out, and then use them everywhere
applicable. Parsing should get this treatment too but I leave it to a
follow up.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81752
Approved by: https://github.com/cpuhrsch, https://github.com/bdhirsh