Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conv2d padding test data #1196

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added testdata/dnn/onnx/data/input_conv2dPadding.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_conv2dPadding.npy
Binary file not shown.
11 changes: 11 additions & 0 deletions testdata/dnn/onnx/generate_onnx_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all lowercase names are preferable for files.


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:
Expand Down
Binary file added testdata/dnn/onnx/models/conv2dPadding.onnx
Binary file not shown.