()
| 180 | |
| 181 | |
| 182 | def 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 | |
| 189 | def test_hsigmoid(): |