File tree 1 file changed +13
-0
lines changed
test/mlir/conversion/onnx_to_tosa/Math
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ func.func @test_cast_f32_i8(%arg0: tensor<13x21x1xf32>) -> tensor<13x21x1xi8> {
19
19
20
20
// -----
21
21
22
+ func.func @test_cast_int4_and_uint4_to_from_int8_uint8 (%arg0: tensor <1 xi4 >, %arg1: tensor <1 xui4 >) -> (tensor <1 xi4 >, tensor <1 xui4 >) {
23
+ %0 = " onnx.Cast" (%arg0 ) {saturate = 1 : si64 , to = i8 } : (tensor <1 xi4 >) -> tensor <1 xi8 >
24
+ %1 = " onnx.Cast" (%0 ) {saturate = 1 : si64 , to = i4 } : (tensor <1 xi8 >) -> tensor <1 xi4 >
25
+ %2 = " onnx.Cast" (%arg1 ) {saturate = 1 : si64 , to = ui8 } : (tensor <1 xui4 >) -> tensor <1 xui8 >
26
+ %3 = " onnx.Cast" (%2 ) {saturate = 1 : si64 , to = ui4 } : (tensor <1 xui8 >) -> tensor <1 xui4 >
27
+ onnx.Return %1 , %3 : tensor <1 xi4 >, tensor <1 xui4 >
28
+ // CHECK-LABEL: func.func @test_cast_int4_and_uint4_to_from_int8_uint8(
29
+ // TOSA does not support int4 casting
30
+ // CHECK-NOT: tosa.cast
31
+ }
32
+
33
+ // -----
34
+
22
35
func.func @test_cast_f16_i8 (%arg0: tensor <13 x21 x1 xf16 >) -> tensor <13 x21 x1 xi8 > {
23
36
%0 = " onnx.Cast" (%arg0 ) {to = i8 } : (tensor <13 x21 x1 xf16 >) -> tensor <13 x21 x1 xi8 >
24
37
" func.return" (%0 ) : (tensor <13 x21 x1 xi8 >) -> ()
You can’t perform that action at this time.
0 commit comments