@@ -187,6 +187,7 @@ func.func @test_reshape_for_broadcast(%arg0: tensor<4x3x2xi32>) -> tensor<4x3x2x
187187
188188// CHECK-LABEL: @test_resnet18_common_case
189189// COM: note that %74 is now represented by %arg2
190+ // CHECK-DAG: %[[CONST0:.+]] = "tosa.const"() <{value = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
190191// CHECK-DAG: %[[VAL_2:.*]] = "tosa.const"() <{value = dense_resource<torch_tensor_64_torch.float32_1> : tensor<64xf32>}> : () -> tensor<64xf32>
191192// CHECK-DAG: %[[VAL_3:.*]] = "tosa.const"() <{value = dense_resource<torch_tensor_64_torch.float32> : tensor<64xf32>}> : () -> tensor<64xf32>
192193// CHECK-DAG: %[[VAL_4:.*]] = "tosa.const"() <{value = dense<9.99999974E-6> : tensor<1xf32>}> : () -> tensor<1xf32>
@@ -197,9 +198,9 @@ func.func @test_reshape_for_broadcast(%arg0: tensor<4x3x2xi32>) -> tensor<4x3x2x
197198// CHECK-DAG: %[[VAL_9:.*]] = tosa.reshape %arg0 {new_shape = array<i64: 1, 1, 1, 64>} : (tensor<64xf32>) -> tensor<1x1x1x64xf32>
198199// CHECK-DAG: %[[VAL_10:.*]] = tosa.sub %arg2, %[[VAL_9]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>) -> tensor<1x112x112x64xf32>
199200// CHECK-DAG: %[[VAL_11:.*]] = tosa.reshape %[[VAL_8]] {new_shape = array<i64: 1, 1, 1, 64>} : (tensor<64xf32>) -> tensor<1x1x1x64xf32>
200- // CHECK-DAG: %[[VAL_12:.*]] = tosa.mul %[[VAL_10]], %[[VAL_11]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>) -> tensor<1x112x112x64xf32>
201+ // CHECK-DAG: %[[VAL_12:.*]] = tosa.mul %[[VAL_10]], %[[VAL_11]], %[[CONST0]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>, tensor<1xi8 >) -> tensor<1x112x112x64xf32>
201202// CHECK-DAG: %[[VAL_13:.*]] = tosa.reshape %[[VAL_3]] {new_shape = array<i64: 1, 1, 1, 64>} : (tensor<64xf32>) -> tensor<1x1x1x64xf32>
202- // CHECK-DAG: %[[VAL_14:.*]] = tosa.mul %[[VAL_12]], %[[VAL_13]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>) -> tensor<1x112x112x64xf32>
203+ // CHECK-DAG: %[[VAL_14:.*]] = tosa.mul %[[VAL_12]], %[[VAL_13]], %[[CONST0]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>, tensor<1xi8 >) -> tensor<1x112x112x64xf32>
203204// CHECK-DAG: %[[VAL_15:.*]] = tosa.reshape %[[VAL_2]] {new_shape = array<i64: 1, 1, 1, 64>} : (tensor<64xf32>) -> tensor<1x1x1x64xf32>
204205// CHECK-DAG: %[[VAL_16:.*]] = tosa.add %[[VAL_14]], %[[VAL_15]] : (tensor<1x112x112x64xf32>, tensor<1x1x1x64xf32>) -> tensor<1x112x112x64xf32>
205206// CHECK-DAG: %[[VAL_17:.*]] = tosa.clamp %[[VAL_16]] {max_fp = 3.40282347E+38 : f32, max_int = 2147483647 : i64, min_fp = 0.000000e+00 : f32, min_int = 0 : i64} : (tensor<1x112x112x64xf32>) -> tensor<1x112x112x64xf32>
@@ -220,9 +221,9 @@ func.func @test_resnet18_common_case(%arg0: tensor<64xf32>, %arg1: tensor<64xf32
220221 %79 = tosa.reshape %arg0 {new_shape = array<i64 : 1 , 64 , 1 , 1 >} : (tensor <64 xf32 >) -> tensor <1 x64 x1 x1 xf32 >
221222 %80 = tosa.sub %75 , %79 : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >) -> tensor <1 x64 x112 x112 xf32 >
222223 %81 = tosa.reshape %78 {new_shape = array<i64 : 1 , 64 , 1 , 1 >} : (tensor <64 xf32 >) -> tensor <1 x64 x1 x1 xf32 >
223- %82 = tosa.mul %80 , %81 : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >) -> tensor <1 x64 x112 x112 xf32 >
224+ %82 = tosa.mul %80 , %81 , %shift : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >, tensor < 1 x i8 >) -> tensor <1 x64 x112 x112 xf32 >
224225 %83 = tosa.reshape %60 {new_shape = array<i64 : 1 , 64 , 1 , 1 >} : (tensor <64 xf32 >) -> tensor <1 x64 x1 x1 xf32 >
225- %84 = tosa.mul %82 , %83 : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >) -> tensor <1 x64 x112 x112 xf32 >
226+ %84 = tosa.mul %82 , %83 , %shift : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >, tensor < 1 x i8 >) -> tensor <1 x64 x112 x112 xf32 >
226227 %85 = tosa.reshape %59 {new_shape = array<i64 : 1 , 64 , 1 , 1 >} : (tensor <64 xf32 >) -> tensor <1 x64 x1 x1 xf32 >
227228 %86 = tosa.add %84 , %85 : (tensor <1 x64 x112 x112 xf32 >, tensor <1 x64 x1 x1 xf32 >) -> tensor <1 x64 x112 x112 xf32 >
228229 %87 = tosa.clamp %86 {max_fp = 3.40282347E+38 : f32 , max_int = 2147483647 : i64 , min_fp = 0.000000e+00 : f32 , min_int = 0 : i64 } : (tensor <1 x64 x112 x112 xf32 >) -> tensor <1 x64 x112 x112 xf32 >
0 commit comments