MCPcopy 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
351def sigmoid(inp):
352 res = 1.0 / (1.0 + exp(-inp))
353 return res.astype(inp.dtype)
354
355
356def sigmoid_grad(y, dy):

Callers 1

silu_gradFunction · 0.70

Calls 2

expFunction · 0.50
astypeMethod · 0.45

Tested by

no test coverage detected