[Mlir-commits] [mlir] [mlir][linalg] Update pack and unpack documentation (PR #143903)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jun 26 09:59:36 PDT 2025


================
@@ -262,21 +270,50 @@ def Linalg_UnPackOp : Linalg_RelayoutOp<"unpack"> {
       `inner_dims_pos[i]` (assuming that `outer_dims_perm` is not specified)
       evenly.
 
+    `inner_dims_pos` (mandatory) specifies `k` result tensor (i.e. unpacked
+    tensor) dimensions that were tiled with the `inner_tiles` to create the
+    packed source tensor. The source tensor (i.e. packed tensor) dimensions can
+    be unpacked given `inner_dims_pos` as follows.
+    - For `0 <= i < k` the following relationship holds:
+    `shape(result)[inner_dims_pos[i]] = shape(source)[n-k+i] + shape(source)[inner_dims_pos[i]]`.
----------------
banach-space wrote:

If there's `/` in `tensor.pack`, then there should be `*` in `tensor.unpack`, right? Also, because of padding, it should be `<=` rather than `=`, right? Please double check :)
```suggestion
    `shape(result)[inner_dims_pos[i]] <= shape(source)[n-k+i] * shape(source)[inner_dims_pos[i]]`.
```

https://github.com/llvm/llvm-project/pull/143903


More information about the Mlir-commits mailing list