Support nested templates in generated code via helper (#73271)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73271
- makes DispatchKeyNativeFunctions template/generator handle multi-level
namespace (e.g. torch::lazy)
- moves helper for constructing prologue/epilogue into 'common' module
Test Plan: run CI (and verified locally in lazy tensor codegen patch)
Reviewed By: bdhirsh
Differential Revision: D34400821
fbshipit-source-id: 420c0e3f487d8b8d0dd16572b5fd16e7df0d4163
(cherry picked from commit 39e430d42864ed1b21ec0757c94e808098871cac)