소개
This skill automates the complex refactoring process of converting PyTorch's legacy AT_DISPATCH macros to the more flexible and extensible V2 API. It handles the critical steps of the migration including header inclusion, argument reordering, lambda wrapping with AT_WRAP to prevent parsing errors, and the transition from implicit arity-based macros (such as AND3 or AND4) to explicit type group expansion using AT_EXPAND. It is specifically designed for developers maintaining ATen kernel implementations, CUDA kernels, or native operator code who need to modernize their C++ codebase according to current PyTorch standards.