From f86feb0aa8a9490a7ab27bc991e36d7b5bf300e3 Mon Sep 17 00:00:00 2001 From: Wenxuan Tan Date: Wed, 7 Jan 2026 10:11:38 -0800 Subject: [PATCH] Fix idx2crd docstring (#2914) * fix idx2crd docstring * fix * fix --- python/CuTeDSL/cutlass/cute/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/CuTeDSL/cutlass/cute/core.py b/python/CuTeDSL/cutlass/cute/core.py index c678f569..6dae39ae 100644 --- a/python/CuTeDSL/cutlass/cute/core.py +++ b/python/CuTeDSL/cutlass/cute/core.py @@ -2990,9 +2990,11 @@ def idx2crd(idx, shape, *, loc=None, ip=None): @cute.jit def foo(): coord = cute.idx2crd(11, (5,4)) - # Computed as: 11 = 2 * 4 + 3, so coordinate is (2, 3) + # idx2crd is always col-major + # For shape (m, n, l, ...), coord = (idx % m, idx // m % n, idx // m // n % l, ... + # Computed as: (11 % 5, 11 // 5 % 4) = (1, 2) print(coord) - foo() # Expected output: (2, 3) + foo() # Expected output: (1, 2) **Note:** Python DSL is aligned with C++ DSL.