forked from Colloportus0/MLIRSmith11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen01392541447564526848-tosa.mlir
17 lines (16 loc) · 1.48 KB
/
gen01392541447564526848-tosa.mlir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module {
func.func @main(%arg0: tensor<1x1x1x1xf32> {iree.identifier = "inputs_0"}) -> (tensor<1x1x1x1xf32> {iree.identifier = "Identity"}, tensor<1x1x1x1xf32> {iree.identifier = "Identity_1"}, tensor<1x1x1x1xf32> {iree.identifier = "Identity_2"}, tensor<1x1x1x1xi32> {iree.identifier = "Identity_3"}) {
%0 = "tosa.const"() {value = dense<5.000000e-01> : tensor<1x1x1x1xf32>} : () -> tensor<1x1x1x1xf32>
%1 = "tosa.const"() {value = dense<1.500000e+00> : tensor<1x1x1x1xf32>} : () -> tensor<1x1x1x1xf32>
%2 = "tosa.const"() {value = dense<-1.500000e+00> : tensor<1x1x1x1xf32>} : () -> tensor<1x1x1x1xf32>
%3 = "tosa.cast"(%arg0) : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xi32>
%4 = "tosa.add"(%arg0, %0) : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%5 = "tosa.floor"(%4) : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%6 = "tosa.avg_pool2d"(%arg0) {kernel = [1, 1], pad = [0, 0, 0, 0], stride = [1, 1]} : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%7 = "tosa.minimum"(%arg0, %1) : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%8 = "tosa.maximum"(%7, %2) : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%9 = "tosa.reciprocal"(%arg0) : (tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
%10 = "tosa.mul"(%8, %9) {shift = 0 : i32} : (tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>) -> tensor<1x1x1x1xf32>
return %6, %5, %10, %3 : tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>, tensor<1x1x1x1xf32>, tensor<1x1x1x1xi32>
}
}