forked from Colloportus0/MLIRSmith11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen014511101413189888-tosa.mlir
16 lines (15 loc) · 1.36 KB
/
gen014511101413189888-tosa.mlir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module {
func.func @main(%arg0: tensor<1x1x1x1xf32> {iree.identifier = "inputs_0"}) -> (tensor<1x1x1x1xf32> {iree.identifier = "Identity"}, tensor<1x1x1x1xf32> {iree.identifier = "Identity_1"}) {
%0 = "tosa.const"() {value = dense<5.949090e+00> : tensor<1x1x1x1xf32>} : () -> tensor<1x1x1x1xf32>
%1 = "tosa.const"() {value = dense<6.00600815> : tensor<1x1x1xf32>} : () -> tensor<1x1x1xf32>
%2 = "tosa.resize"(%arg0) {mode = "BILINEAR", offset = [0, 0], offset_fp = [0.000000e+00 : f32, 0.000000e+00 : f32], output_size = [1, 1], shift = 0 : i32, stride = [0, 0], stride_fp = [1.000000e+00 : f32, 1.000000e+00 : f32]} : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%3 = "tosa.reshape"(%2) {new_shape = [1, 1, 1]} : (tensor<1x1x1x1xf32>) -> tensor<1x1x1xf32>
%4 = "tosa.matmul"(%3, %1) : (tensor<1x1x1xf32>, tensor<1x1x1xf32>) -> tensor<1x1x1xf32>
%5 = "tosa.reshape"(%4) {new_shape = [1, 1, 1, 1]} : (tensor<1x1x1xf32>) -> tensor<1x1x1x1xf32>
%6 = "tosa.add"(%5, %0) : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%7 = "tosa.exp"(%2) : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%8 = "tosa.reciprocal"(%7) : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%9 = "tosa.mul"(%7, %8) {shift = 0 : i32} : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
return %9, %6 : tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>
}
}