at-dispatch-v2
Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.
Security Assessment
About at-dispatch-v2
The at-dispatch-v2 skill is designed to facilitate the conversion of PyTorch's legacy AT_DISPATCH macros into the more modern AT_DISPATCH_V2 format. This transformation is essential for developers who are porting older AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, and similar macros to the new v2 API in ATen C++ code. By automating this conversion process, the skill helps maintain compatibility with the latest dispatch features while ensuring that the code remains efficient and easier to understand.
FAQ
What does the at-dispatch-v2 skill do?
It converts legacy AT_DISPATCH macros to the new AT_DISPATCH_V2 format in PyTorch's ATen C++ code.
When should I use this skill?
Use this skill when porting AT_DISPATCH macros to the v2 API, especially in ATen kernel files or CUDA kernels.
Are there any specific file directories I should focus on?
Yes, focus on files in the 'aten/src/ATen/native/' directory that utilize dispatch macros.
Is there a compatibility requirement for using this skill?
The skill is intended for use with PyTorch codebases that are transitioning to the v2 API.
What are the main transformations this skill performs?
It reorders arguments, wraps lambdas, expands type groups, lists individual types, and adds necessary includes.
Install at-dispatch-v2
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
pytorch/pytorch