[Mlir-commits] [mlir] [mlir][tosa] Add pass to assign static input shape to TOSA functions (PR #171156)
Sayan Saha
llvmlistbot at llvm.org
Wed Dec 10 05:14:43 PST 2025
sahas3 wrote:
Hi @lhutton1, not directly related to this PR but is there any way to propagate the static shapes to `reciprocal` in the example you shared:
```
func.func @test(%arg0: tensor<2x16xi32>, %arg1: tensor<?x256xf32>, %arg2: tensor<64x9xf32>) -> (tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>) {
%0 = tosa.add %arg0, %arg0 : (tensor<2x16xi32>, tensor<2x16xi32>) -> tensor<2x16xi32>
%cast = tensor.cast %0 : tensor<2x16xi32> to tensor<2x?xi32>
%1 = tosa.reciprocal %arg1 : (tensor<?x256xf32>) -> tensor<?x256xf32>
%2 = tosa.sub %arg2, %arg2 : (tensor<64x9xf32>, tensor<64x9xf32>) -> tensor<64x9xf32>
%cast_0 = tensor.cast %2 : tensor<64x9xf32> to tensor<?x9xf32>
return %cast, %1, %cast_0 : tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>
}
```
Thanks!
https://github.com/llvm/llvm-project/pull/171156
More information about the Mlir-commits
mailing list