[Mlir-commits] [mlir] [mlir][linalg] Update pack and unpack documentation (PR #143903)
Adam Siemieniuk
llvmlistbot at llvm.org
Thu Jun 12 08:24:11 PDT 2025
================
@@ -117,6 +119,16 @@ def Linalg_PackOp : Linalg_RelayoutOp<"pack", [
into %dest : tensor<128x256xf32> -> tensor<16x8 x 8x32 xf32>
// \ / \ /
// outer dims inner dims
+ // CHW to CHWhw
+ %0 = linalg.pack %source inner_dims_pos = [2, 1] inner_tiles = [4, 2]
+ into %dest : tensor<1x8x16xf32> -> tensor<1x2x4 x 4x2 xf32>
+ // \ / \ /
+ // outer dims inner dims
+ // HCW to HCWhw
+ %0 = linalg.pack %source inner_dims_pos = [2, 0] inner_tiles = [4, 2]
+ into %dest : tensor<20x1x12xf32> -> tensor<10x1x3 x 4x2xf32>
+ // \ / \ /
+ // Outer Dims: 10x1x3 Inner Dims: 4x2
----------------
adam-smnk wrote:
nit: I like this explicit repetition of dims `Outer Dims: 10x1x3`, could you add that to the other examples as well for consistency?
https://github.com/llvm/llvm-project/pull/143903
More information about the Mlir-commits
mailing list