From 43f2500c26e026ed9c6e4e529f101e7f092f89de Mon Sep 17 00:00:00 2001 From: tigertang Date: Wed, 18 Nov 2020 14:36:12 +0800 Subject: [PATCH] Add symbolic for SwishJitAutoFn to support onnx --- timm/models/layers/activations_me.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/timm/models/layers/activations_me.py b/timm/models/layers/activations_me.py index 0441f7c4..d1b9de5a 100644 --- a/timm/models/layers/activations_me.py +++ b/timm/models/layers/activations_me.py @@ -30,6 +30,9 @@ class SwishJitAutoFn(torch.autograd.Function): Inspired by conversation btw Jeremy Howard & Adam Pazske https://twitter.com/jeremyphoward/status/1188251041835315200 """ + @staticmethod + def symbolic(g, x): + return g.op("Mul", x, g.op("Sigmoid", x)) @staticmethod def forward(ctx, x):