Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ hsigmoid
Function
hsigmoid
imperative/python/megengine/xla/rules/elemwise.py:361–365 ·
view source on GitHub ↗
(x)
Source
from the content-addressed store, hash-verified
359
360
361
def
hsigmoid(x):
362
from
.tensor
import
where
363
364
res = where(x <= -3.0, 0.0, where(x >= 3.0, 1.0, (x + 3.0) / 6.0))
365
return
res.astype(x.dtype)
366
367
368
def
hsigmoid_grad(x, dy):
Callers
nothing calls this directly
Calls
2
where
Function · 0.70
astype
Method · 0.45
Tested by
no test coverage detected