Skip to content

Commit a3e4431

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents f7df4bd + 61ea2e2 commit a3e4431

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed
176 Bytes
Binary file not shown.
176 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

+12
Original file line numberDiff line numberDiff line change
@@ -1233,3 +1233,15 @@ def forward(self, x):
12331233
x = Variable(torch.randn([1, 2, 2, 2]))
12341234
model = Mish()
12351235
save_data_and_model("mish", x, model)
1236+
1237+
class PadCalculation(nn.Module):
1238+
def forward(self, x):
1239+
y = F.max_pool2d(x, kernel_size=2)
1240+
diff_h = x.shape[2] - y.shape[2]
1241+
diff_w = x.shape[3] - y.shape[3]
1242+
y = F.pad(y, [diff_w // 2, diff_w - diff_w // 2, diff_h // 2, diff_h - diff_h // 2])
1243+
return y
1244+
1245+
x = Variable(torch.randn([1, 1, 3, 4]))
1246+
model = PadCalculation()
1247+
save_data_and_model("calc_pads", x, model, version=11)
2.93 KB
Binary file not shown.

0 commit comments

Comments
 (0)