[Mlir-commits] [mlir] [mlir][tosa] Fix assertion failure in tosa-layerwise-constant-fold (PR #85670)

Tina Jung llvmlistbot at llvm.org
Tue Mar 19 01:10:55 PDT 2024


================
@@ -114,6 +114,25 @@ func.func @transpose_nofold_quantized_types() -> tensor<1x1x2x2x!quant.uniform<i
 
 // -----
 
+// CHECK-LABEL: @transpose_dense_resource
+func.func @transpose_dense_resource() -> tensor<2x2xf32> {
+    %0 = "tosa.const"() <{value = dense_resource<resource> : tensor<2x2xf32>}> : () -> tensor<2x2xf32>
+    %1 = "tosa.const"() <{value = dense<[1, 0]> : tensor<2xi32>}> : () -> tensor<2xi32>
+
+    // CHECK: tosa.transpose
----------------
TinaAMD wrote:

I haven't work with `dense_resources` yet, but as you refactored the `transposeType` folder I would have assumed that this could be folded away if the resource is available. Otherwise, wouldn't it have sufficed to use `tryGetValues`?

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


More information about the Mlir-commits mailing list