Skip to content

Commit 8a7fc93

Browse files
committed
Merge pull request #835 from l-bat:lb/onnx_mish_subgraph
2 parents 3d46b11 + c9b1ece commit 8a7fc93

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

testdata/dnn/onnx/data/input_mish.npy

160 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1224,4 +1224,12 @@ def forward(self, x):
12241224

12251225
x = Variable(torch.randn(1, 2, 20, 20))
12261226
model = Conv1ResizePoold()
1227-
save_data_and_model("conv_resize_pool_1d", x, model)
1227+
save_data_and_model("conv_resize_pool_1d", x, model)
1228+
1229+
class Mish(nn.Module):
1230+
def forward(self, x):
1231+
return x * (torch.tanh(F.softplus(x)))
1232+
1233+
x = Variable(torch.randn([1, 2, 2, 2]))
1234+
model = Mish()
1235+
save_data_and_model("mish", x, model)

testdata/dnn/onnx/models/mish.onnx

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pytorch1.7:�
2+

3+
01
4+
Softplus_0"Softplus
5+

6+
12Tanh_1"Tanh
7+

8+
0
9+
23Mul_2"Multorch-jit-exportZ
10+
0
11+

12+

13+

14+

15+
b
16+
3
17+

18+

19+

20+

21+
B

0 commit comments

Comments
 (0)