MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / test_silu

Function test_silu

imperative/python/test/unit/functional/test_elemwise.py:182–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181
182def test_silu():
183 x = np.array([-1.5, 0.0, 1.0, 1.5]).astype("float32")
184 y_np = x / (1 + np.exp(-x))
185 y_mge = F.silu(tensor(x)).numpy()
186 np.testing.assert_almost_equal(y_np, y_mge, decimal=6)
187
188
189def test_hsigmoid():

Callers

nothing calls this directly

Calls 4

arrayMethod · 0.80
astypeMethod · 0.45
expMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected