Created
July 10, 2019 08:16
-
-
Save Lexie88rus/01e81cc442afc498070b97a5dffcef2e to your computer and use it in GitHub Desktop.
Example of implementation of in-place SiLU activation function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def silu_inplace_2(input): | |
''' | |
Example of implementation of in-place SiLU activation function using torch.sigmoid_ | |
https://arxiv.org/pdf/1606.08415.pdf | |
''' | |
result = input.clone() | |
torch.sigmoid_(input) | |
input *= result | |
return input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment