MCPcopy 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
341def relu(inp):
342 mask = (inp > 0.0).astype(inp.dtype)
343 return inp * mask
344
345
346def relu_grad(x, dy):

Callers 3

fuse_add_reluFunction · 0.70
softplusFunction · 0.70
softplus_gradFunction · 0.70

Calls 1

astypeMethod · 0.45

Tested by

no test coverage detected