Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ sigmoid
Function
sigmoid
imperative/python/megengine/xla/rules/elemwise.py:351–353 ·
view source on GitHub ↗
(inp)
Source
from the content-addressed store, hash-verified
349
350
351
def
sigmoid(inp):
352
res = 1.0 / (1.0 + exp(-inp))
353
return
res.astype(inp.dtype)
354
355
356
def
sigmoid_grad(y, dy):
Callers
1
silu_grad
Function · 0.70
Calls
2
exp
Function · 0.50
astype
Method · 0.45
Tested by
no test coverage detected