[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EX19Y579SF8N32ZF7F5S8K":3,"skill-same:01M6EX19Y579SF8N32ZF7F5S8K":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M6EX19Y579SF8N32ZF7F5S8K","add-uint-support",null,"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.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fpytorch\u002Fadd-uint-support\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34],"support","add","add uint support","pytorch","user","use","dispatch","macros","operators","type","types","2026-11-10 10:12:30",false,"---\nname: add-uint-support\ndescription: 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.\n---\n\n# Add Unsigned Integer (uint) Support to Operators\n\nThis skill helps add support for unsigned integer types (uint16, uint32, uint64) to PyTorch operators by updating their AT_DISPATCH macros.\n\n## When to use this skill\n\nUse this skill when:\n- Adding uint16, uint32, or uint64 support to an operator\n- User mentions \"unsigned types\", \"uint support\", \"barebones unsigned types\"\n- Enabling support for kUInt16, kUInt32, kUInt64 in kernels\n- Working with operator implementations that need expanded type coverage\n\n## Quick reference\n\n**Add unsigned types to existing dispatch:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES));\n\n\u002F\u002F After (method 1: add unsigned types explicitly)\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES));\n\n\u002F\u002F After (method 2: use V2 integral types if AT_INTEGRAL_TYPES present)\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES));\n```\n\n## Type group reference\n\n**Unsigned type groups:**\n- `AT_BAREBONES_UNSIGNED_TYPES`: kUInt16, kUInt32, kUInt64\n- `AT_INTEGRAL_TYPES_V2`: AT_INTEGRAL_TYPES + AT_BAREBONES_UNSIGNED_TYPES\n\n**Relationship:**\n```cpp\nAT_INTEGRAL_TYPES          \u002F\u002F kByte, kChar, kInt, kLong, kShort\nAT_BAREBONES_UNSIGNED_TYPES  \u002F\u002F kUInt16, kUInt32, kUInt64\nAT_INTEGRAL_TYPES_V2       \u002F\u002F INTEGRAL_TYPES + BAREBONES_UNSIGNED_TYPES\n```\n\n## Instructions\n\n### Step 1: Determine if conversion to V2 is needed\n\nCheck if the file uses AT_DISPATCH_V2:\n\n**If using old AT_DISPATCH:**\n- First convert to AT_DISPATCH_V2 using the at-dispatch-v2 skill\n- Then proceed with adding uint support\n\n**If already using AT_DISPATCH_V2:**\n- Proceed directly to Step 2\n\n### Step 2: Analyze the current dispatch macro\n\nIdentify what type groups are currently in use:\n\n```cpp\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  \u002F\u002F body\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n    ^^^^^^^^^^^^^^^^^^^^^^^^^\n    Current type coverage\n```\n\nCommon patterns:\n- `AT_EXPAND(AT_ALL_TYPES)` → includes AT_INTEGRAL_TYPES + AT_FLOATING_TYPES\n- `AT_EXPAND(AT_INTEGRAL_TYPES)` → signed integers only\n- `AT_EXPAND(AT_FLOATING_TYPES)` → floating point types\n\n### Step 3: Choose the uint addition method\n\nTwo approaches:\n\n**Method 1: Add AT_BAREBONES_UNSIGNED_TYPES explicitly**\n- Use when: You want to be explicit about adding uint support\n- Add `AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES)` to the type list\n\n**Method 2: Substitute AT_INTEGRAL_TYPES with AT_INTEGRAL_TYPES_V2**\n- Use when: The dispatch already uses `AT_EXPAND(AT_INTEGRAL_TYPES)`\n- More concise: replaces one type group with its superset\n- Only applicable if AT_INTEGRAL_TYPES is present\n\n### Step 4: Apply the transformation\n\n**Method 1 example:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(\n    dtype,\n    \"min_values_cuda\",\n    AT_WRAP([&]() {\n      kernel_impl\u003Cscalar_t>(iter);\n    }),\n    AT_EXPAND(AT_ALL_TYPES),\n    kBFloat16, kHalf, kBool\n);\n\n\u002F\u002F After (add unsigned types)\nAT_DISPATCH_V2(\n    dtype,\n    \"min_values_cuda\",\n    AT_WRAP([&]() {\n      kernel_impl\u003Cscalar_t>(iter);\n    }),\n    AT_EXPAND(AT_ALL_TYPES),\n    AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES),\n    kBFloat16, kHalf, kBool\n);\n```\n\n**Method 2 example:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(\n    dtype,\n    \"integral_op\",\n    AT_WRAP([&]() {\n      kernel\u003Cscalar_t>();\n    }),\n    AT_EXPAND(AT_INTEGRAL_TYPES)\n);\n\n\u002F\u002F After (substitute with V2)\nAT_DISPATCH_V2(\n    dtype,\n    \"integral_op\",\n    AT_WRAP([&]() {\n      kernel\u003Cscalar_t>();\n    }),\n    AT_EXPAND(AT_INTEGRAL_TYPES_V2)\n);\n```\n\n### Step 5: Handle AT_ALL_TYPES vs individual type groups\n\nIf the dispatch uses `AT_EXPAND(AT_ALL_TYPES)`:\n- `AT_ALL_TYPES` = `AT_INTEGRAL_TYPES` + `AT_FLOATING_TYPES`\n- To add uint: add `AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES)` to the list\n\nIf the dispatch separately lists INTEGRAL and FLOATING:\n```cpp\n\u002F\u002F Before\nAT_EXPAND(AT_INTEGRAL_TYPES), AT_EXPAND(AT_FLOATING_TYPES)\n\n\u002F\u002F After (Method 2 preferred)\nAT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES)\n```\n\n### Step 6: Verify all dispatch sites\n\nCheck the file for ALL dispatch macros that need uint support:\n- Some operators have multiple dispatch sites (CPU, CUDA, different functions)\n- Apply the transformation consistently across all sites\n- Ensure each gets the same type coverage updates\n\n### Step 7: Validate the changes\n\nCheck that:\n- [ ] AT_DISPATCH_V2 format is used (not old AT_DISPATCH)\n- [ ] Unsigned types are added via one of the two methods\n- [ ] All relevant dispatch sites in the file are updated\n- [ ] Type groups use `AT_EXPAND()`\n- [ ] Arguments are properly formatted and comma-separated\n\n## Common patterns\n\n### Pattern 1: AT_ALL_TYPES + extras\n\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n\n\u002F\u002F After\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kHalf, kBFloat16);\n```\n\n### Pattern 2: Separate INTEGRAL + FLOATING\n\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES), AT_EXPAND(AT_FLOATING_TYPES));\n\n\u002F\u002F After\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES));\n```\n\n### Pattern 3: Old dispatch needs conversion first\n\n```cpp\n\u002F\u002F Before (needs v2 conversion first)\nAT_DISPATCH_ALL_TYPES_AND2(kHalf, kBFloat16, dtype, \"op\", [&]() {\n  kernel\u003Cscalar_t>();\n});\n\n\u002F\u002F After v2 conversion\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n\n\u002F\u002F After adding uint support\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kHalf, kBFloat16);\n```\n\n## Multiple dispatch sites example\n\nFor a file with multiple functions:\n\n```cpp\nvoid min_values_kernel_cuda(TensorIterator& iter) {\n  AT_DISPATCH_V2(iter.dtype(), \"min_values_cuda\", AT_WRAP([&]() {\n    impl\u003Cscalar_t>(iter);\n  }), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kBFloat16, kHalf);\n  \u002F\u002F                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \u002F\u002F                           Added uint support\n}\n\nvoid min_launch_kernel(TensorIterator &iter) {\n  AT_DISPATCH_V2(iter.input_dtype(), \"min_cuda\", AT_WRAP([&]() {\n    gpu_reduce_kernel\u003Cscalar_t>(iter);\n  }), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kBFloat16, kHalf);\n  \u002F\u002F                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \u002F\u002F                           Added uint support here too\n}\n```\n\n## Decision tree\n\nUse this decision tree to determine the approach:\n\n```\nIs the file using AT_DISPATCH_V2?\n├─ No → Use at-dispatch-v2 skill first, then continue\n└─ Yes\n   └─ Does it use AT_EXPAND(AT_INTEGRAL_TYPES)?\n      ├─ Yes → Replace with AT_EXPAND(AT_INTEGRAL_TYPES_V2)\n      └─ No → Add AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES) to type list\n```\n\n## Edge cases\n\n### Case 1: Dispatch with only floating types\n\nIf the operator only supports floating point types, don't add uint support:\n\n```cpp\n\u002F\u002F Leave as-is - floating point only operator\nAT_DISPATCH_V2(dtype, \"float_op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_FLOATING_TYPES), kHalf);\n```\n\n### Case 2: Complex types present\n\nUnsigned types work alongside complex types:\n\n```cpp\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES),\n    AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES),\n    AT_EXPAND(AT_COMPLEX_TYPES),\n    kHalf, kBFloat16);\n```\n\n### Case 3: Already has uint support\n\nCheck if uint types are already present:\n- If `AT_INTEGRAL_TYPES_V2` is used → already has uint support\n- If `AT_BAREBONES_UNSIGNED_TYPES` is already in list → already has uint support\n- Skip the file if uint support is already present\n\n## Workflow\n\nWhen asked to add uint support:\n\n1. Read the target file\n2. Check if using AT_DISPATCH_V2:\n   - If not → use at-dispatch-v2 skill first\n3. Identify all dispatch macro sites\n4. For each dispatch:\n   - Analyze current type groups\n   - Choose method (add BAREBONES_UNSIGNED or upgrade to V2)\n   - Apply transformation with Edit tool\n5. Show the user the changes\n6. Explain what was modified\n\n## Important notes\n\n- Always check if v2 conversion is needed first\n- Apply changes consistently across all dispatch sites in the file\n- Method 2 (AT_INTEGRAL_TYPES_V2) is cleaner when applicable\n- Method 1 (explicit AT_BAREBONES_UNSIGNED_TYPES) is more explicit\n- Unsigned types are: kUInt16, kUInt32, kUInt64 (not kByte which is uint8)\n- Some operators may not semantically support unsigned types - use judgment\n\n## Testing\n\nAfter adding uint support, the operator should accept uint16, uint32, and uint64 tensors. The user is responsible for functional testing.\n","# Add Unsigned Integer (uint) Support to Operators\n\nThis skill helps add support for unsigned integer types (uint16, uint32, uint64) to PyTorch operators by updating their AT_DISPATCH macros.\n\n## When to use this skill\n\nUse this skill when:\n- Adding uint16, uint32, or uint64 support to an operator\n- User mentions \"unsigned types\", \"uint support\", \"barebones unsigned types\"\n- Enabling support for kUInt16, kUInt32, kUInt64 in kernels\n- Working with operator implementations that need expanded type coverage\n\n## Quick reference\n\n**Add unsigned types to existing dispatch:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES));\n\n\u002F\u002F After (method 1: add unsigned types explicitly)\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES));\n\n\u002F\u002F After (method 2: use V2 integral types if AT_INTEGRAL_TYPES present)\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES));\n```\n\n## Type group reference\n\n**Unsigned type groups:**\n- `AT_BAREBONES_UNSIGNED_TYPES`: kUInt16, kUInt32, kUInt64\n- `AT_INTEGRAL_TYPES_V2`: AT_INTEGRAL_TYPES + AT_BAREBONES_UNSIGNED_TYPES\n\n**Relationship:**\n```cpp\nAT_INTEGRAL_TYPES          \u002F\u002F kByte, kChar, kInt, kLong, kShort\nAT_BAREBONES_UNSIGNED_TYPES  \u002F\u002F kUInt16, kUInt32, kUInt64\nAT_INTEGRAL_TYPES_V2       \u002F\u002F INTEGRAL_TYPES + BAREBONES_UNSIGNED_TYPES\n```\n\n## Instructions\n\n### Step 1: Determine if conversion to V2 is needed\n\nCheck if the file uses AT_DISPATCH_V2:\n\n**If using old AT_DISPATCH:**\n- First convert to AT_DISPATCH_V2 using the at-dispatch-v2 skill\n- Then proceed with adding uint support\n\n**If already using AT_DISPATCH_V2:**\n- Proceed directly to Step 2\n\n### Step 2: Analyze the current dispatch macro\n\nIdentify what type groups are currently in use:\n\n```cpp\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  \u002F\u002F body\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n    ^^^^^^^^^^^^^^^^^^^^^^^^^\n    Current type coverage\n```\n\nCommon patterns:\n- `AT_EXPAND(AT_ALL_TYPES)` → includes AT_INTEGRAL_TYPES + AT_FLOATING_TYPES\n- `AT_EXPAND(AT_INTEGRAL_TYPES)` → signed integers only\n- `AT_EXPAND(AT_FLOATING_TYPES)` → floating point types\n\n### Step 3: Choose the uint addition method\n\nTwo approaches:\n\n**Method 1: Add AT_BAREBONES_UNSIGNED_TYPES explicitly**\n- Use when: You want to be explicit about adding uint support\n- Add `AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES)` to the type list\n\n**Method 2: Substitute AT_INTEGRAL_TYPES with AT_INTEGRAL_TYPES_V2**\n- Use when: The dispatch already uses `AT_EXPAND(AT_INTEGRAL_TYPES)`\n- More concise: replaces one type group with its superset\n- Only applicable if AT_INTEGRAL_TYPES is present\n\n### Step 4: Apply the transformation\n\n**Method 1 example:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(\n    dtype,\n    \"min_values_cuda\",\n    AT_WRAP([&]() {\n      kernel_impl\u003Cscalar_t>(iter);\n    }),\n    AT_EXPAND(AT_ALL_TYPES),\n    kBFloat16, kHalf, kBool\n);\n\n\u002F\u002F After (add unsigned types)\nAT_DISPATCH_V2(\n    dtype,\n    \"min_values_cuda\",\n    AT_WRAP([&]() {\n      kernel_impl\u003Cscalar_t>(iter);\n    }),\n    AT_EXPAND(AT_ALL_TYPES),\n    AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES),\n    kBFloat16, kHalf, kBool\n);\n```\n\n**Method 2 example:**\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(\n    dtype,\n    \"integral_op\",\n    AT_WRAP([&]() {\n      kernel\u003Cscalar_t>();\n    }),\n    AT_EXPAND(AT_INTEGRAL_TYPES)\n);\n\n\u002F\u002F After (substitute with V2)\nAT_DISPATCH_V2(\n    dtype,\n    \"integral_op\",\n    AT_WRAP([&]() {\n      kernel\u003Cscalar_t>();\n    }),\n    AT_EXPAND(AT_INTEGRAL_TYPES_V2)\n);\n```\n\n### Step 5: Handle AT_ALL_TYPES vs individual type groups\n\nIf the dispatch uses `AT_EXPAND(AT_ALL_TYPES)`:\n- `AT_ALL_TYPES` = `AT_INTEGRAL_TYPES` + `AT_FLOATING_TYPES`\n- To add uint: add `AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES)` to the list\n\nIf the dispatch separately lists INTEGRAL and FLOATING:\n```cpp\n\u002F\u002F Before\nAT_EXPAND(AT_INTEGRAL_TYPES), AT_EXPAND(AT_FLOATING_TYPES)\n\n\u002F\u002F After (Method 2 preferred)\nAT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES)\n```\n\n### Step 6: Verify all dispatch sites\n\nCheck the file for ALL dispatch macros that need uint support:\n- Some operators have multiple dispatch sites (CPU, CUDA, different functions)\n- Apply the transformation consistently across all sites\n- Ensure each gets the same type coverage updates\n\n### Step 7: Validate the changes\n\nCheck that:\n- [ ] AT_DISPATCH_V2 format is used (not old AT_DISPATCH)\n- [ ] Unsigned types are added via one of the two methods\n- [ ] All relevant dispatch sites in the file are updated\n- [ ] Type groups use `AT_EXPAND()`\n- [ ] Arguments are properly formatted and comma-separated\n\n## Common patterns\n\n### Pattern 1: AT_ALL_TYPES + extras\n\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n\n\u002F\u002F After\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kHalf, kBFloat16);\n```\n\n### Pattern 2: Separate INTEGRAL + FLOATING\n\n```cpp\n\u002F\u002F Before\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES), AT_EXPAND(AT_FLOATING_TYPES));\n\n\u002F\u002F After\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_INTEGRAL_TYPES_V2), AT_EXPAND(AT_FLOATING_TYPES));\n```\n\n### Pattern 3: Old dispatch needs conversion first\n\n```cpp\n\u002F\u002F Before (needs v2 conversion first)\nAT_DISPATCH_ALL_TYPES_AND2(kHalf, kBFloat16, dtype, \"op\", [&]() {\n  kernel\u003Cscalar_t>();\n});\n\n\u002F\u002F After v2 conversion\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), kHalf, kBFloat16);\n\n\u002F\u002F After adding uint support\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kHalf, kBFloat16);\n```\n\n## Multiple dispatch sites example\n\nFor a file with multiple functions:\n\n```cpp\nvoid min_values_kernel_cuda(TensorIterator& iter) {\n  AT_DISPATCH_V2(iter.dtype(), \"min_values_cuda\", AT_WRAP([&]() {\n    impl\u003Cscalar_t>(iter);\n  }), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kBFloat16, kHalf);\n  \u002F\u002F                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \u002F\u002F                           Added uint support\n}\n\nvoid min_launch_kernel(TensorIterator &iter) {\n  AT_DISPATCH_V2(iter.input_dtype(), \"min_cuda\", AT_WRAP([&]() {\n    gpu_reduce_kernel\u003Cscalar_t>(iter);\n  }), AT_EXPAND(AT_ALL_TYPES), AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES), kBFloat16, kHalf);\n  \u002F\u002F                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \u002F\u002F                           Added uint support here too\n}\n```\n\n## Decision tree\n\nUse this decision tree to determine the approach:\n\n```\nIs the file using AT_DISPATCH_V2?\n├─ No → Use at-dispatch-v2 skill first, then continue\n└─ Yes\n   └─ Does it use AT_EXPAND(AT_INTEGRAL_TYPES)?\n      ├─ Yes → Replace with AT_EXPAND(AT_INTEGRAL_TYPES_V2)\n      └─ No → Add AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES) to type list\n```\n\n## Edge cases\n\n### Case 1: Dispatch with only floating types\n\nIf the operator only supports floating point types, don't add uint support:\n\n```cpp\n\u002F\u002F Leave as-is - floating point only operator\nAT_DISPATCH_V2(dtype, \"float_op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_FLOATING_TYPES), kHalf);\n```\n\n### Case 2: Complex types present\n\nUnsigned types work alongside complex types:\n\n```cpp\nAT_DISPATCH_V2(dtype, \"op\", AT_WRAP([&]() {\n  kernel\u003Cscalar_t>();\n}), AT_EXPAND(AT_ALL_TYPES),\n    AT_EXPAND(AT_BAREBONES_UNSIGNED_TYPES),\n    AT_EXPAND(AT_COMPLEX_TYPES),\n    kHalf, kBFloat16);\n```\n\n### Case 3: Already has uint support\n\nCheck if uint types are already present:\n- If `AT_INTEGRAL_TYPES_V2` is used → already has uint support\n- If `AT_BAREBONES_UNSIGNED_TYPES` is already in list → already has uint support\n- Skip the file if uint support is already present\n\n## Workflow\n\nWhen asked to add uint support:\n\n1. Read the target file\n2. Check if using AT_DISPATCH_V2:\n   - If not → use at-dispatch-v2 skill first\n3. Identify all dispatch macro sites\n4. For each dispatch:\n   - Analyze current type groups\n   - Choose method (add BAREBONES_UNSIGNED or upgrade to V2)\n   - Apply transformation with Edit tool\n5. Show the user the changes\n6. Explain what was modified\n\n## Important notes\n\n- Always check if v2 conversion is needed first\n- Apply changes consistently across all dispatch sites in the file\n- Method 2 (AT_INTEGRAL_TYPES_V2) is cleaner when applicable\n- Method 1 (explicit AT_BAREBONES_UNSIGNED_TYPES) is more explicit\n- Unsigned types are: kUInt16, kUInt32, kUInt64 (not kByte which is uint8)\n- Some operators may not semantically support unsigned types - use judgment\n\n## Testing\n\nAfter adding uint support, the operator should accept uint16, uint32, and uint64 tensors. The user is responsible for functional testing.\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fpytorch\u002Fadd-uint-support",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill add-uint-support",{"tool":55,"command":56},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill add-uint-support",{"tool":58,"command":59},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill add-uint-support","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fpytorch\u002Fadd-uint-support\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"skill-report.json","REFERENCE","参考文档",13601,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fpytorch\u002Fadd-uint-support\u002Fskill-report.json",[70,80,90,99,105,112],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":76,"publishedAt":35},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[75],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[77,78,79],"model","model hierarchy","model hierarchy skill",{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":86,"publishedAt":35},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[85],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[87,88,89],"MCP","zoom","zoom mcp",{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":35},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[96,97,98,88],"sdk","zoom apps sdk","apps",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":35},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[101],{"skillNo":106,"name":107,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":111,"publishedAt":35},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[110],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[107],{"skillNo":113,"name":114,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":35},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[114]]