nn.SiLU() export support (#1713)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-12-16 17:55:57 -08:00
1 parent c923fbff90
commit 6bd5e8bca7
2 files changed
+9 -6

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ import torch.nn as nn
import torch.nn.functional as F
# Swish https://arxiv.org/pdf/1905.02244.pdf ---------------------------------------------------------------------------
class Swish(nn.Module): #
# SiLU https://arxiv.org/pdf/1905.02244.pdf ----------------------------------------------------------------------------
class SiLU(nn.Module): # export-friendly version of nn.SiLU()
@staticmethod
def forward(x):
return x * torch.sigmoid(x)