44// level constants. This is a pragmatic choice which lets us have a lot
55// of tests in this file, whereas the others tend to be more bespoke.
66
7+ // CHECK-LABEL: func.func @test_greater
8+ func.func @test_greater (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 > attributes {torch.onnx_meta.ir_version = 7 : si64 , torch.onnx_meta.opset_version = 16 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
9+ // CHECK-SAME: %[[ARG0:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
10+ // CHECK-SAME: %[[ARG1:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
11+ // CHECK: torch.aten.gt.Tensor %[[ARG0]], %[[ARG1]] : !torch.vtensor<[3,4,5],f32>, !torch.vtensor<[3,4,5],f32> -> !torch.vtensor<[3,4,5],i1>
12+ %0 = torch.operator " onnx.Greater" (%arg0 , %arg1 ) : (!torch.vtensor <[3 ,4 ,5 ],f32 >, !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 >
13+ return %0 : !torch.vtensor <[3 ,4 ,5 ],i1 >
14+ }
15+
16+ // CHECK-LABEL: func.func @test_greater_or_equal
17+ func.func @test_greater_or_equal (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 > attributes {torch.onnx_meta.ir_version = 7 : si64 , torch.onnx_meta.opset_version = 16 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
18+ // CHECK-SAME: %[[ARG0:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
19+ // CHECK-SAME: %[[ARG1:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
20+ // CHECK: torch.aten.ge.Tensor %[[ARG0]], %[[ARG1]] : !torch.vtensor<[3,4,5],f32>, !torch.vtensor<[3,4,5],f32> -> !torch.vtensor<[3,4,5],i1>
21+ %0 = torch.operator " onnx.GreaterOrEqual" (%arg0 , %arg1 ) : (!torch.vtensor <[3 ,4 ,5 ],f32 >, !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 >
22+ return %0 : !torch.vtensor <[3 ,4 ,5 ],i1 >
23+ }
24+
25+ // CHECK-LABEL: func.func @test_less
26+ func.func @test_less (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 > attributes {torch.onnx_meta.ir_version = 7 : si64 , torch.onnx_meta.opset_version = 13 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
27+ // CHECK-SAME: %[[ARG0:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
28+ // CHECK-SAME: %[[ARG1:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
29+ // CHECK: torch.aten.lt.Tensor %[[ARG0]], %[[ARG1]] : !torch.vtensor<[3,4,5],f32>, !torch.vtensor<[3,4,5],f32> -> !torch.vtensor<[3,4,5],i1>
30+ %0 = torch.operator " onnx.Less" (%arg0 , %arg1 ) : (!torch.vtensor <[3 ,4 ,5 ],f32 >, !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 >
31+ return %0 : !torch.vtensor <[3 ,4 ,5 ],i1 >
32+ }
33+
734// CHECK-LABEL: func.func @test_gather_elements
835func.func @test_gather_elements (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ], si64 >) -> !torch.vtensor <[3 ,4 ,5 ],f32 > attributes {torch.onnx_meta.opset_version = 13 : si64 } {
936 // CHECK-DAG: %[[INT0:.+]] = torch.constant.int 0
@@ -43,10 +70,10 @@ func.func @test_matmul_4d(%arg0: !torch.vtensor<[1,2,3,4],f32>, %arg1: !torch.vt
4370}
4471
4572// CHECK-LABEL: func.func @test_less_or_equal
46- func.func @test_less_or_equal (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 > attributes {torch.onnx_meta.ir_version = 7 : si64 , torch.onnx_meta.opset_version = 13 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
73+ func.func @test_less_or_equal (%arg0: !torch.vtensor <[3 ,4 ,5 ],f32 >, %arg1: !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 > attributes {torch.onnx_meta.ir_version = 7 : si64 , torch.onnx_meta.opset_version = 16 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
4774 // CHECK-SAME: %[[ARG0:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
4875 // CHECK-SAME: %[[ARG1:[a-zA-Z0-9]+]]: !torch.vtensor<[3,4,5],f32>
4976 // CHECK: torch.aten.le.Tensor %[[ARG0]], %[[ARG1]] : !torch.vtensor<[3,4,5],f32>, !torch.vtensor<[3,4,5],f32> -> !torch.vtensor<[3,4,5],i1>
5077 %0 = torch.operator " onnx.LessOrEqual" (%arg0 , %arg1 ) : (!torch.vtensor <[3 ,4 ,5 ],f32 >, !torch.vtensor <[3 ,4 ,5 ],f32 >) -> !torch.vtensor <[3 ,4 ,5 ],i1 >
5178 return %0 : !torch.vtensor <[3 ,4 ,5 ],i1 >
52- }
79+ }
0 commit comments