Skip to content

Commit 018f2b1

Browse files
committed
Add pooling testcases
1 parent 19a0b53 commit 018f2b1

7 files changed

+34
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

+13
Original file line numberDiff line numberDiff line change
@@ -1107,3 +1107,16 @@ def forward(self, x):
11071107
model = ResizeConv(2, 0, 2)
11081108
save_data_and_model("resize_opset11_torch1.6_dynamic_axes", x, model, 11)
11091109
postprocess_model("models/resize_opset11_torch1.6_dynamic_axes.onnx", [["batch_size", 2, 'height', 'width']])
1110+
1111+
maxpooling_sigmoid = nn.Sequential(
1112+
nn.MaxPool2d(kernel_size=4, stride=2, padding=(1, 2), dilation=1),
1113+
nn.Sigmoid()
1114+
)
1115+
input = Variable(torch.randn(2, 3, 12, 18))
1116+
save_data_and_model("maxpooling_sigmoid_dynamic_axes", input, maxpooling_sigmoid)
1117+
postprocess_model("models/maxpooling_sigmoid_dynamic_axes.onnx", [[2, 3, 'height', 'width']])
1118+
1119+
ave_pool = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)
1120+
input = Variable(torch.randn(1, 3, 7, 5))
1121+
save_data_and_model("average_pooling_dynamic_axes", input, ave_pool)
1122+
postprocess_model("models/average_pooling_dynamic_axes.onnx", [[1, 3, 'height', 'width']])
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pytorch1.6:�
2+
V
3+
01 MaxPool_0"MaxPool*
4+
kernel_shape@@�*
5+
pads@@@@�*
6+
strides@@�
7+

8+
12 Sigmoid_1"Sigmoidtorch-jit-exportZ&
9+
0!
10+

11+

12+

13+
height
14+
widthb
15+
2
16+

17+

18+

19+

20+

21+
B

0 commit comments

Comments
 (0)