@@ -1296,6 +1296,93 @@ func.func @test_convtranspose(%arg0: !torch.vtensor<[1,1,3,3],f32>, %arg1: !torc
12961296
12971297// -----
12981298
1299+ // CHECK-LABEL: @test_convtranspose_output_shape_autopad_valid
1300+ func.func @test_convtranspose_output_shape_autopad_valid (%arg0: !torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, %arg1: !torch.vtensor <[1 ,2 ,4 ,4 ],f32 >) -> !torch.vtensor <[1 ,2 ,9 ,9 ],f32 > attributes {torch.onnx_meta.ir_version = 10 : si64 , torch.onnx_meta.opset_version = 22 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
1301+ // CHECK: %[[C0:.*]] = torch.constant.int 0
1302+ // CHECK: %[[C0_0:.*]] = torch.constant.int 0
1303+ // CHECK: %[[C1:.*]] = torch.constant.int 1
1304+ // CHECK: %[[C1_0:.*]] = torch.constant.int 1
1305+ // CHECK: %[[C2:.*]] = torch.constant.int 2
1306+ // CHECK: %[[C2_0:.*]] = torch.constant.int 2
1307+ // CHECK: %[[C1_1:.*]] = torch.constant.int 1
1308+ // CHECK: %[[C1_2:.*]] = torch.constant.int 1
1309+ // CHECK: %[[PADDING:.*]] = torch.prim.ListConstruct %[[C0]], %[[C0_0]] : (!torch.int, !torch.int) -> !torch.list<int>
1310+ // CHECK: %[[DILATIONS:.*]] = torch.prim.ListConstruct %[[C1]], %[[C1_0]] : (!torch.int, !torch.int) -> !torch.list<int>
1311+ // CHECK: %[[STRIDE:.*]] = torch.prim.ListConstruct %[[C2]], %[[C2_0]] : (!torch.int, !torch.int) -> !torch.list<int>
1312+ // CHECK: %[[OUTPUT_PADDING:.*]] = torch.prim.ListConstruct %[[C1_1]], %[[C1_2]] : (!torch.int, !torch.int) -> !torch.list<int>
1313+ // CHECK: torch.aten.convolution %arg0, %arg1, {{.*}}, %[[STRIDE]], %[[PADDING]], %[[DILATIONS]], {{.*}}, %[[OUTPUT_PADDING]], {{.*}} -> !torch.vtensor<[1,2,9,9],f32>
1314+ %0 = torch.operator " onnx.ConvTranspose" (%arg0 , %arg1 ) {torch.onnx.auto_pad =" VALID" , torch.onnx.output_shape = [9 : si64 , 9 : si64 ], torch.onnx.strides = [2 : si64 , 2 : si64 ]} : (!torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, !torch.vtensor <[1 ,2 ,4 ,4 ],f32 >) -> !torch.vtensor <[1 ,2 ,9 ,9 ],f32 >
1315+ return %0 : !torch.vtensor <[1 ,2 ,9 ,9 ],f32 >
1316+ }
1317+
1318+ // -----
1319+
1320+ // CHECK-LABEL: @test_convtranspose_output_shape
1321+ func.func @test_convtranspose_output_shape (%arg0: !torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, %arg1: !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,10 ,8 ],f32 > attributes {torch.onnx_meta.ir_version = 10 : si64 , torch.onnx_meta.opset_version = 22 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
1322+ // CHECK: %[[C0:.*]] = torch.constant.int 0
1323+ // CHECK: %[[C0_0:.*]] = torch.constant.int 0
1324+ // CHECK: %[[C1:.*]] = torch.constant.int 1
1325+ // CHECK: %[[C1_0:.*]] = torch.constant.int 1
1326+ // CHECK: %[[C3:.*]] = torch.constant.int 3
1327+ // CHECK: %[[C2:.*]] = torch.constant.int 2
1328+ // CHECK: %[[C1_1:.*]] = torch.constant.int 1
1329+ // CHECK: %[[C1_2:.*]] = torch.constant.int 1
1330+ // CHECK: %[[PADDING:.*]] = torch.prim.ListConstruct %[[C0]], %[[C0_0]] : (!torch.int, !torch.int) -> !torch.list<int>
1331+ // CHECK: %[[DILATIONS:.*]] = torch.prim.ListConstruct %[[C1]], %[[C1_0]] : (!torch.int, !torch.int) -> !torch.list<int>
1332+ // CHECK: %[[STRIDE:.*]] = torch.prim.ListConstruct %[[C3]], %[[C2]] : (!torch.int, !torch.int) -> !torch.list<int>
1333+ // CHECK: %[[OUTPUT_PADDING:.*]] = torch.prim.ListConstruct %[[C1_1]], %[[C1_2]] : (!torch.int, !torch.int) -> !torch.list<int>
1334+ // CHECK: %[[TRANSPOSED:.*]] = torch.constant.bool true
1335+ // CHECK: %[[BIAS:.*]] = torch.constant.none
1336+ // CHECK: %[[GROUPS:.*]] = torch.constant.int 1
1337+ // CHECK: torch.aten.convolution %arg0, %arg1, %[[BIAS]], %[[STRIDE]], %[[PADDING]], %[[DILATIONS]], %[[TRANSPOSED]], %[[OUTPUT_PADDING]], %[[GROUPS]] : !torch.vtensor<[1,1,3,3],f32>, !torch.vtensor<[1,2,3,3],f32>, !torch.none, !torch.list<int>, !torch.list<int>, !torch.list<int>, !torch.bool, !torch.list<int>, !torch.int -> !torch.vtensor<[1,2,10,8],f32>
1338+ %0 = torch.operator " onnx.ConvTranspose" (%arg0 , %arg1 ) {torch.onnx.output_shape = [10 : si64 , 8 : si64 ], torch.onnx.strides = [3 : si64 , 2 : si64 ]} : (!torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,10 ,8 ],f32 >
1339+ return %0 : !torch.vtensor <[1 ,2 ,10 ,8 ],f32 >
1340+ }
1341+
1342+ // -----
1343+
1344+ // CHECK-LABEL: @test_convtranspose_output_shape_with_output_padding
1345+ func.func @test_convtranspose_output_shape_with_output_padding (%arg0: !torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, %arg1: !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,10 ,8 ],f32 > attributes {torch.onnx_meta.ir_version = 10 : si64 , torch.onnx_meta.opset_version = 22 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
1346+ // CHECK: %[[PADV0:.*]] = torch.constant.int 0
1347+ // CHECK: %[[PADV1:.*]] = torch.constant.int 0
1348+ // CHECK: %[[DILV0:.*]] = torch.constant.int 1
1349+ // CHECK: %[[DILV1:.*]] = torch.constant.int 1
1350+ // CHECK: %[[STRV0:.*]] = torch.constant.int 3
1351+ // CHECK: %[[STRV1:.*]] = torch.constant.int 2
1352+ // CHECK: %[[OPADV0:.*]] = torch.constant.int 1
1353+ // CHECK: %[[OPADV1:.*]] = torch.constant.int 1
1354+ // CHECK: %[[PADDING:.*]] = torch.prim.ListConstruct %[[PADV0]], %[[PADV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1355+ // CHECK: %[[DILATIONS:.*]] = torch.prim.ListConstruct %[[DILV0]], %[[DILV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1356+ // CHECK: %[[STRIDE:.*]] = torch.prim.ListConstruct %[[STRV0]], %[[STRV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1357+ // CHECK: %[[OUTPUT_PADDING:.*]] = torch.prim.ListConstruct %[[OPADV0]], %[[OPADV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1358+ // CHECK: torch.aten.convolution %arg0, %arg1, {{.*}}, %[[STRIDE]], %[[PADDING]], %[[DILATIONS]], {{.*}}, %[[OUTPUT_PADDING]], {{.*}} -> !torch.vtensor<[1,2,10,8],f32>
1359+ %0 = torch.operator " onnx.ConvTranspose" (%arg0 , %arg1 ) {torch.onnx.output_padding = [1 : si64 , 1 : si64 ], torch.onnx.output_shape = [10 : si64 , 8 : si64 ], torch.onnx.strides = [3 : si64 , 2 : si64 ]} : (!torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,10 ,8 ],f32 >
1360+ return %0 : !torch.vtensor <[1 ,2 ,10 ,8 ],f32 >
1361+ }
1362+
1363+ // -----
1364+
1365+ // CHECK-LABEL: @test_convtranspose_output_shape_with_pads
1366+ func.func @test_convtranspose_output_shape_with_pads (%arg0: !torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, %arg1: !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,8 ,5 ],f32 > attributes {torch.onnx_meta.ir_version = 10 : si64 , torch.onnx_meta.opset_version = 22 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
1367+ // CHECK: %[[PADV0:.*]] = torch.constant.int 1
1368+ // CHECK: %[[PADV1:.*]] = torch.constant.int 1
1369+ // CHECK: %[[DILV0:.*]] = torch.constant.int 1
1370+ // CHECK: %[[DILV1:.*]] = torch.constant.int 1
1371+ // CHECK: %[[STRV0:.*]] = torch.constant.int 3
1372+ // CHECK: %[[STRV1:.*]] = torch.constant.int 2
1373+ // CHECK: %[[OPADV0:.*]] = torch.constant.int 1
1374+ // CHECK: %[[OPADV1:.*]] = torch.constant.int 0
1375+ // CHECK: %[[PADDING:.*]] = torch.prim.ListConstruct %[[PADV0]], %[[PADV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1376+ // CHECK: %[[DILATIONS:.*]] = torch.prim.ListConstruct %[[DILV0]], %[[DILV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1377+ // CHECK: %[[STRIDE:.*]] = torch.prim.ListConstruct %[[STRV0]], %[[STRV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1378+ // CHECK: %[[OUTPUT_PADDING:.*]] = torch.prim.ListConstruct %[[OPADV0]], %[[OPADV1]] : (!torch.int, !torch.int) -> !torch.list<int>
1379+ // CHECK: torch.aten.convolution %arg0, %arg1, {{.*}}, %[[STRIDE]], %[[PADDING]], %[[DILATIONS]], {{.*}}, %[[OUTPUT_PADDING]], {{.*}} -> !torch.vtensor<[1,2,8,5],f32>
1380+ %0 = torch.operator " onnx.ConvTranspose" (%arg0 , %arg1 ) {torch.onnx.output_shape = [8 : si64 , 5 : si64 ], torch.onnx.pads = [1 : si64 , 1 : si64 , 1 : si64 , 1 : si64 ], torch.onnx.strides = [3 : si64 , 2 : si64 ]} : (!torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,8 ,5 ],f32 >
1381+ return %0 : !torch.vtensor <[1 ,2 ,8 ,5 ],f32 >
1382+ }
1383+
1384+ // -----
1385+
12991386// CHECK-LABEL: @test_convtranspose_pad
13001387 func.func @test_convtranspose_pad (%arg0: !torch.vtensor <[1 ,1 ,3 ,3 ],f32 >, %arg1: !torch.vtensor <[1 ,2 ,3 ,3 ],f32 >) -> !torch.vtensor <[1 ,2 ,10 ,8 ],f32 > attributes {torch.onnx_meta.ir_version = 6 : si64 , torch.onnx_meta.opset_version = 11 : si64 , torch.onnx_meta.producer_name = " backend-test" , torch.onnx_meta.producer_version = " " } {
13011388 // CHECK: %[[C0:.*]] = torch.constant.int 0
0 commit comments