Skip to content

Commit

Permalink
Add pooling testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
sl-sergei committed Oct 15, 2020
1 parent f19047c commit 0089324
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions testdata/dnn/onnx/generate_onnx_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,3 +1070,16 @@ def forward(self, x):
model = ResizeConv(2, 0, 2)
save_data_and_model("resize_opset11_torch1.6_dynamic_axes", x, model, 11)
postprocess_model("models/resize_opset11_torch1.6_dynamic_axes.onnx", [["batch_size", 2, 'height', 'width']])

maxpooling_sigmoid = nn.Sequential(
nn.MaxPool2d(kernel_size=4, stride=2, padding=(1, 2), dilation=1),
nn.Sigmoid()
)
input = Variable(torch.randn(2, 3, 12, 18))
save_data_and_model("maxpooling_sigmoid_dynamic_axes", input, maxpooling_sigmoid)
postprocess_model("models/maxpooling_sigmoid_dynamic_axes.onnx", [[2, 3, 'height', 'width']])

ave_pool = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)
input = Variable(torch.randn(1, 3, 7, 5))
save_data_and_model("average_pooling_dynamic_axes", input, ave_pool)
postprocess_model("models/average_pooling_dynamic_axes.onnx", [[1, 3, 'height', 'width']])
Binary file not shown.
21 changes: 21 additions & 0 deletions testdata/dnn/onnx/models/maxpooling_sigmoid_dynamic_axes.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pytorch1.6:�
V
01 MaxPool_0"MaxPool*
kernel_shape@@�*
pads@@@@�*
strides@@�

12 Sigmoid_1"Sigmoidtorch-jit-exportZ&
0!



height
widthb
2





B

0 comments on commit 0089324

Please sign in to comment.