MCPcopy 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
361def 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
368def hsigmoid_grad(x, dy):

Callers

nothing calls this directly

Calls 2

whereFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected