add-uint-support

Update PyTorch AT_DISPATCH macros to support unsigned integer types.

1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/teddytennant/rusttorch --skill add-uint-support-teddytennant
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-uint-support
Source: https://github.com/teddytennant/rusttorch/tree/main/.claude/skills/add-uint-support
Command: npx skills add https://github.com/teddytennant/rusttorch --skill add-uint-support-teddytennant

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates adding unsigned integer support (uint16, uint32, uint64) to PyTorch operators by updating AT_DISPATCH macros and type groups.

Core Features & Use Cases

  • Macro updates: Add AT_BAREBONES_UNSIGNED_TYPES or upgrade to AT_INTEGRAL_TYPES_V2 for unsigned types.
  • Consistent coverage: Apply across all relevant AT_DISPATCH_V2 sites.
  • Use case: Enable operators to accept uint tensors in addition to existing signed and floating types.

Quick Start

Example: Add uint support to an existing AT_DISPATCH_V2(dtype, "op", AT_WRAP(&{ kernel<scalar_t>(); }), AT_EXPAND(AT_ALL_TYPES));

Frequently Asked Questions about add-uint-support

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add unsigned integer support to PyTorch operators?

Add unsigned integer support by updating AT_DISPATCH macros to include AT_BAREBONES_UNSIGNED_TYPES or AT_INTEGRAL_TYPES_V2. This extends operators to accept uint16, uint32, and uint64 tensors alongside existing signed and floating-point types.

What is AT_DISPATCH_V2 and when do I need to upgrade to it?

AT_DISPATCH_V2 is PyTorch's macro for type dispatching in kernel implementations. Upgrade to it when adding unsigned type support, as it provides better type group management and compatibility with AT_EXPAND macros for unsigned types.

Can I apply unsigned type support across multiple dispatch sites at once?

Yes. Identify all relevant AT_DISPATCH_V2 sites in your operator and apply AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES) or AT_INTEGRAL_TYPES_V2 consistently across each macro to ensure uniform unsigned type coverage.

What's the difference between AT_BAREBONES_UNSIGNED_TYPES and AT_INTEGRAL_TYPES_V2?

AT_BAREBONES_UNSIGNED_TYPES provides minimal unsigned type coverage (uint16, uint32, uint64), while AT_INTEGRAL_TYPES_V2 includes unsigned types plus signed integers and other integral types for broader dispatch coverage.

Do I need to modify kernel code itself to support unsigned integers?

No. Adding unsigned support through AT_DISPATCH macros and type groups enables the existing kernel code to handle unsigned tensors automatically, provided the kernel logic is type-agnostic.

What happens if I don't update dispatch macros when adding uint tensors?

Operators will reject unsigned integer tensors at runtime. Updating AT_DISPATCH macros with unsigned type groups is required to make operators accept and process uint tensors correctly.