Skip to content

Commit 23a54da

Browse files
authored
Merge pull request #990 from zihaomu:layer_fused_optmized_mish
Add onnx mish without softplus
2 parents 4e72d02 + 3d5b610 commit 23a54da

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed
160 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,14 @@ def forward(self, x):
18211821
model = Mish()
18221822
save_data_and_model("mish", x, model)
18231823

1824+
class Mish2(nn.Module):
1825+
def forward(self, x):
1826+
return x * (torch.tanh(torch.log(torch.exp(x) + 1)))
1827+
1828+
x = Variable(torch.randn([1, 2, 2, 2]))
1829+
model = Mish2()
1830+
save_data_and_model("mish_no_softplus", x, model)
1831+
18241832
class PadCalculation(nn.Module):
18251833
def forward(self, x):
18261834
y = F.max_pool2d(x, kernel_size=2)
257 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)