[Mlir-commits] [mlir] [mlir][Tensor] Generalize the pattern to swap `tensor.collapse_shape` -> `tensor.expand_shape`. (PR #133819)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Apr 15 13:43:44 PDT 2025
================
@@ -48,14 +48,67 @@ func.func @no_bubble_partial_intersecting_reshapes(%arg0: tensor<?x?x?x?xf32>, %
// -----
-func.func @no_bubble_0d_tensor_reshapes(%arg0: tensor<?xf32>, %s0: index, %s1: index, %s2: index, %s3: index) -> tensor<?x?x?x?xf32> {
- %collapse = tensor.collapse_shape %arg0 [] : tensor<?xf32> into tensor<f32>
+func.func @no_bubble_0d_tensor_reshapes(%arg0: tensor<1x1xf32>) -> tensor<1x1x1xf32> {
----------------
MaheshRavishankar wrote:
Yeah, actually the original reshape is not really well defined. The only valid value for `?` in the original example was 1. So its hard to assert in the verifier for the op, but at runtime, any value other than 1 would be invalid. So its kind of a corner case representation thing. So just fixed the test to avoid this case.
https://github.com/llvm/llvm-project/pull/133819
More information about the Mlir-commits
mailing list