AT

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.zip

Installs 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.
269 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

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

You give it
Legacy AT_DISPATCH macro code block
You get back
Refactored AT_DISPATCH_V2 code block

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

ATen C++ source access

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.

SkillInstallsUpdatedSafetyDifficulty
at-dispatch-v2 (this skill)51yNo flagsIntermediate
dev_unity_unreal09moNo flagsAdvanced
unreal-engine-cpp-pro437moNo flagsAdvanced
code-coverage-with-gcov157moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry