[Mlir-commits] [mlir] [tosa] : Enhance EqualizeRanks to handle dynamic dimensions. (PR #168564)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Nov 18 10:58:43 PST 2025


Jerry-Ge wrote:

> I've verified that with the fix the IR is legalized correctly to
> 
> ```
> func.func @main(%arg0: tensor<?x?x?x?xf32>) -> tensor<?x?x?x5xf32> {
>     %0 = "tosa.const"() <{values = dense<0.000000e+00> : tensor<1x1x1x5xf32>}> : () -> tensor<1x1x1x5xf32>
>     %1 = tosa.add %arg0, %0 : (tensor<?x?x?x?xf32>, tensor<1x1x1x5xf32>) -> tensor<?x?x?x5xf32>
>     return %1 : tensor<?x?x?x5xf32>
>   }
> ```
> 
> However, I am not sure what test I can add here to lock this down. If you have any suggestions on adding unit-tests please let me know. Thanks!

Thanks for fixing this! How about adding the test case you constructed somewhere here? https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir 

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


More information about the Mlir-commits mailing list