Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ relu
Function
relu
imperative/python/megengine/xla/rules/elemwise.py:341–343 ·
view source on GitHub ↗
(inp)
Source
from the content-addressed store, hash-verified
339
340
341
def
relu(inp):
342
mask = (inp > 0.0).astype(inp.dtype)
343
return
inp * mask
344
345
346
def
relu_grad(x, dy):
Callers
3
fuse_add_relu
Function · 0.70
softplus
Function · 0.70
softplus_grad
Function · 0.70
Calls
1
astype
Method · 0.45
Tested by
no test coverage detected