Back to Skills

add-uint-support

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.

96,741stars26,551forksUpdated 1/20/2026

Security Assessment

Safe(100/100)
Security Score100/100

About add-uint-support

The 'add-uint-support' skill is designed to enhance PyTorch operators by incorporating support for unsigned integer types such as uint16, uint32, and uint64. This skill addresses the need for broader type coverage in operator implementations, allowing developers to leverage unsigned integers where previously only signed integers were supported. By updating the AT_DISPATCH macros, this skill ensures that the addition of these types is both streamlined and efficient, ultimately improving the versatility and capability of PyTorch's computational tools.

One of the main features of this skill is its ability to seamlessly integrate unsigned integer support into existing operator implementations. It provides two distinct methods for achieving this: explicitly adding unsigned types to the dispatch or substituting existing type groups with their more inclusive counterparts. This flexibility allows developers to choose the most appropriate method based on their current code structure, promoting best practices in type management. The skill is particularly beneficial for kernel developers and those involved in extending PyTorch's functionalities, offering clear guidelines for implementation.

Target users of this skill include PyTorch developers who are looking to enhance their operator implementations with unsigned integer support, particularly when user requirements highlight the need for such types. This skill is also useful for contributors to the PyTorch ecosystem who are working on improving type coverage and ensuring that operators can handle a wider range of data types efficiently. By following the structured steps outlined in this documentation, users can effectively add uint support to their projects, thereby enriching the capabilities of their applications.

FAQ

How do I determine if I need to convert to V2?

Check if the file currently uses AT_DISPATCH_V2. If it uses an older version, convert it to AT_DISPATCH_V2 before adding uint support.

What are the two methods to add unsigned types?

You can either explicitly add AT_BAREBONES_UNSIGNED_TYPES to the type list or substitute AT_INTEGRAL_TYPES with AT_INTEGRAL_TYPES_V2 if applicable.

Can I use this skill with existing operator implementations?

Yes, this skill is specifically designed to extend existing operators by adding support for unsigned integer types.

What type groups are included in AT_BAREBONES_UNSIGNED_TYPES?

AT_BAREBONES_UNSIGNED_TYPES includes kUInt16, kUInt32, and kUInt64.

Is this skill compatible with all PyTorch versions?

This skill is intended for use with versions that support AT_DISPATCH_V2.

Install add-uint-support

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

pytorch/pytorch