Skip to content

Commit ff9268d

Browse files
authored
Merge pull request #806 from sl-sergei:testdata_for_resize_opset11
Testdata for Resize operation with Pytorch version==1.6 and newer
1 parent 6927bec commit ff9268d

File tree

4 files changed

+25
-0
lines changed

4 files changed

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

testdata/dnn/onnx/generate_onnx_models.py

+25
Original file line numberDiff line numberDiff line change
@@ -952,3 +952,28 @@ def forward(self, x):
952952
x = Variable(torch.randn(1, 3, 2, 2))
953953
model = ReduceMax()
954954
save_data_and_model("reduce_max", x, model)
955+
956+
class ResizeConv(nn.Module):
957+
def __init__(
958+
self,
959+
in_channels,
960+
skip_channels,
961+
out_channels,
962+
use_batchnorm=True,
963+
attention_type=None,
964+
):
965+
super().__init__()
966+
self.conv1 = conv = nn.Conv2d(
967+
in_channels,
968+
out_channels,
969+
kernel_size=2,
970+
bias=False)
971+
972+
def forward(self, x, skip=None):
973+
x = F.interpolate(x, scale_factor=2, mode="nearest")
974+
x = self.conv1(x)
975+
return x
976+
977+
x = Variable(torch.rand(1, 2, 2, 2))
978+
model = ResizeConv(2, 0, 2)
979+
save_data_and_model("resize_opset11_torch1.6", x, model, 11)
Binary file not shown.

0 commit comments

Comments
 (0)