[Mlir-commits] [mlir] [mlir][tensor] Enhance SimplifyPackToExpandShape for unit dim cases. (PR #79247)

lorenzo chelini llvmlistbot at llvm.org
Wed Jan 24 05:21:29 PST 2024


================
@@ -83,6 +83,57 @@ func.func @single_first_inner_dim_packing(%arg0: tensor<256x5xf32>) -> tensor<8x
 
 // -----
 
+// CHECK-LABEL: func.func @pack_1d_to_1d
+// CHECK-SAME:    %[[ARG0:[0-9a-zA-Z]+]]
+// CHECK:         %[[EXPANDED:.+]] = tensor.expand_shape %[[ARG0]] {{\[}}[0], [1, 2, 3]]
+// CHECK:         return %[[EXPANDED]]
+func.func @pack_1d_to_1d(%arg0 : tensor<1x32xf32>) -> tensor<1x32x1x1xf32> {
----------------
chelini wrote:

i would keep the naming consistent with the functions below: pack_1x32_to_1x32x1x1

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


More information about the Mlir-commits mailing list