Skip to content

Commit 103fe5f

Browse files
committed
Advance LLVM to llvm/llvm-project@cdf10d7: [mlir][tosa] Add error if verification to pooling operators (#130052) (Luke Hutton on 2025-03-12 10:48:33 -0700) (32 of 33)
Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
1 parent bbf7ff7 commit 103fe5f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/e2e/tosa_ops/negate.mlir

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
func.func @tensor_float() {
22
%0 = util.unfoldable_constant dense<[-1.0, -0.5, 0.0, 1.0]> : tensor<4xf32>
3-
%result = tosa.negate %0 : (tensor<4xf32>) -> tensor<4xf32>
3+
%input_zp = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>
4+
%output_zp = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>
5+
%result = tosa.negate %0, %input_zp, %output_zp : (tensor<4xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<4xf32>
46
check.expect_almost_eq_const(%result, dense<[1.0, 0.5, 0.0, -1.0]> : tensor<4xf32>) : tensor<4xf32>
57
return
68
}
79

810
func.func @tensor_int() {
911
%0 = util.unfoldable_constant dense<[-1, 0, 3, 1]> : tensor<4xi32>
10-
%result = tosa.negate %0 : (tensor<4xi32>) -> tensor<4xi32>
12+
%input_zp = "tosa.const"() <{values = dense<0> : tensor<1xi32>}> : () -> tensor<1xi32>
13+
%output_zp = "tosa.const"() <{values = dense<0> : tensor<1xi32>}> : () -> tensor<1xi32>
14+
%result = tosa.negate %0, %input_zp, %output_zp : (tensor<4xi32>, tensor<1xi32>, tensor<1xi32>) -> tensor<4xi32>
1115
check.expect_eq_const(%result, dense<[1, 0, -3, -1]> : tensor<4xi32>) : tensor<4xi32>
1216
return
1317
}

third_party/llvm-project

Submodule llvm-project updated 1474 files

0 commit comments

Comments
 (0)