Fix the mish_grad test case.

This commit is contained in:
liqiliang 2022-06-07 17:18:17 +08:00
parent c03f481902
commit 6409772e72
2 changed files with 3 additions and 3 deletions

View File

@ -182,5 +182,5 @@ def test_mish_grad_dynamic_shape(mode):
output = MishGradDynamicShapeNet(MishNet())(x, dout)
expect_output = np.array([[18.000065, 0.12141099, 0.],
[12., 1.0490363, 2.1],
[11., 4.218619, 0.21672803]], dtype=np.float32)
np.testing.assert_almost_equal(output[0].asnumpy(), expect_output)
[11., 4.218617, 0.2167282]], dtype=np.float32)
assert np.allclose(output[0].asnumpy(), expect_output, atol=1e-4, rtol=1e-4, equal_nan=True)

View File

@ -200,4 +200,4 @@ def test_mish_grad_dynamic_shape(mode):
[-0.24231756, -1.1413976, -0.6648672]],
[[-1.3482721, 0.22441003, 0.05531899],
[-0.41695648, -1.2767013, 0.12779452]]]]).astype(np.float32)
np.testing.assert_almost_equal(output[0].asnumpy(), expect_output)
assert np.allclose(output[0].asnumpy(), expect_output, atol=1e-4, rtol=1e-4, equal_nan=True)