Skip to content

Commit 62c209b

Browse files
authored
[mlir][tosa] add test of scalar mul op (#128088)
This patch adds a lit test for mul op of scalar input1 and input2 but rank-1 shift operand to make sure output is still scalar Signed-off-by: Tai Ly <[email protected]>
1 parent 2ff80d2 commit 62c209b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mlir/test/Dialect/Tosa/ops.mlir

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,15 @@ func.func @test_mul_scalar_with_unranked_output(%arg0: tensor<f32>, %arg1: tenso
346346
}
347347

348348
// -----
349-
// CHECK-LABEL: mul
349+
// CHECK-LABEL: test_mul_scalar
350+
func.func @test_mul_scalar(%arg0: tensor<f32>, %arg1: tensor<f32>) -> tensor<f32> {
351+
%shift = "tosa.const"() <{value = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
352+
%0 = tosa.mul %arg0, %arg1, %shift : (tensor<f32>, tensor<f32>, tensor<1xi8>) -> tensor<f32>
353+
return %0 : tensor<f32>
354+
}
355+
356+
// -----
357+
// CHECK-LABEL: test_mul
350358
func.func @test_mul(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1x3xf32>) -> tensor<13x21x3xf32> {
351359
%shift = "tosa.const"() <{value = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
352360
%0 = tosa.mul %arg0, %arg1, %shift : (tensor<13x21x3xf32>, tensor<13x1x3xf32>, tensor<1xi8>) -> tensor<13x21x3xf32>

0 commit comments

Comments
 (0)