at-dispatch-v2
Automates the conversion of legacy PyTorch AT_DISPATCH macros to the new v2 format for ATen C++ kernels.
Install
mkdir -p .claude/skills/at-dispatch-v2 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/337" && unzip -o skill.zip -d .claude/skills/at-dispatch-v2 && rm skill.zipInstalls to .claude/skills/at-dispatch-v2
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Reorder arguments for V2 API compliance
- →Wrap lambdas using the AT_WRAP helper
- →Expand type groups like AT_ALL_TYPES
- →Update kernel header includes
- →Identify legacy dispatch macro patterns
How it works
Applies a syntax transformation rule set to update legacy dispatch macros to the modern Dispatch_v2 header requirements.
Inputs & outputs
When to use at-dispatch-v2
- →Porting legacy ATen kernels
- →Upgrading ATen native operators to V2
- →Modernizing C++ kernel dispatch logic
About at-dispatch-v2
Updates AT_DISPATCH_* macros in ATen native operator implementations to the v2 API. It handles argument reordering, lambda wrapping, and type group expansion.
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.
When not to use it
- →Modifying non-ATen C++ kernels
- →Updating PyTorch core logic outside dispatch macros
Prerequisites
Limitations
- →Only applies to ATen/native operators
- →Requires existing header availability
How it compares
Automates strict API structural changes required by the PyTorch library transition.
Compared to similar skills
at-dispatch-v2 side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| at-dispatch-v2 (this skill) | 5 | 1y | No flags | Intermediate |
| dev_unity_unreal | 0 | 9mo | No flags | Advanced |
| unreal-engine-cpp-pro | 43 | 7mo | No flags | Advanced |
| code-coverage-with-gcov | 15 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by pytorch
View all by pytorch →You might also like
dev_unity_unreal
AllurinsX
dev_unity_unreal — an agent skill by AllurinsX.
unreal-engine-cpp-pro
sickn33
Expert guide for Unreal Engine 5.x C++ development, covering UObject hygiene, performance patterns, and best practices.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects
add-uint-support
pytorch
Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.
cpp-pro
sickn33
Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization. Use PROACTIVELY for C++ refactoring, memory safety, or complex C++ patterns.
defi-protocol-templates
wshobson
Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and lending systems. Use when building decentralized finance applications or smart contract protocols.