diff --git a/testdata/dnn/onnx/data/input_conv2dPadding.npy b/testdata/dnn/onnx/data/input_conv2dPadding.npy new file mode 100644 index 000000000..3e018f6fd Binary files /dev/null and b/testdata/dnn/onnx/data/input_conv2dPadding.npy differ diff --git a/testdata/dnn/onnx/data/output_conv2dPadding.npy b/testdata/dnn/onnx/data/output_conv2dPadding.npy new file mode 100644 index 000000000..3198aac64 Binary files /dev/null and b/testdata/dnn/onnx/data/output_conv2dPadding.npy differ diff --git a/testdata/dnn/onnx/generate_onnx_models.py b/testdata/dnn/onnx/generate_onnx_models.py index 6cfe6aca1..db1e8e483 100644 --- a/testdata/dnn/onnx/generate_onnx_models.py +++ b/testdata/dnn/onnx/generate_onnx_models.py @@ -1581,6 +1581,17 @@ def forward(self, x): save_data_and_model("unflatten", x, model, export_params=True) +class Conv2D(nn.Module): + def __init__(self, in_chanl, out_chanl, kernel_size, stride=1, padding=0): + super(Conv2D, self).__init__() + self.layer = nn.Conv2d(in_chanl, out_chanl, kernel_size, stride, padding) + def forward(self, x): + return self.layer(x) + +model = Conv2D(3, 6, 3, 1, 1) +x = torch.randn(1, 3, 30, 30) * 30 +save_data_and_model("conv2dPadding", x, model, export_params=True) + def _extract_value_info(x, name, type_proto=None): # type: (Union[List[Any], np.ndarray, None], Text, Optional[TypeProto]) -> onnx.ValueInfoProto if type_proto is None: if x is None: diff --git a/testdata/dnn/onnx/models/conv2dPadding.onnx b/testdata/dnn/onnx/models/conv2dPadding.onnx new file mode 100644 index 000000000..33b9c835a Binary files /dev/null and b/testdata/dnn/onnx/models/conv2dPadding.onnx differ