未验证 提交 25c0eb28 编写于 作者: A Aurelius84 提交者: GitHub

fix unittest random failed test=develop (#19654)

上级 5c4eb394
...@@ -505,8 +505,9 @@ class DistributionTest(unittest.TestCase): ...@@ -505,8 +505,9 @@ class DistributionTest(unittest.TestCase):
feed={'logits': logits_np}, feed={'logits': logits_np},
fetch_list=[entropy_np, kl_np]) fetch_list=[entropy_np, kl_np])
np.testing.assert_allclose( np.testing.assert_allclose(
output_entropy_np, gt_entropy_np, rtol=tolerance) output_entropy_np, gt_entropy_np, rtol=tolerance, atol=tolerance)
np.testing.assert_allclose(output_kl_np, gt_kl_np, rtol=tolerance) np.testing.assert_allclose(
output_kl_np, gt_kl_np, rtol=tolerance, atol=tolerance)
def test_multivariateNormalDiag_distribution(self, def test_multivariateNormalDiag_distribution(self,
batch_size=2, batch_size=2,
...@@ -568,8 +569,9 @@ class DistributionTest(unittest.TestCase): ...@@ -568,8 +569,9 @@ class DistributionTest(unittest.TestCase):
}, },
fetch_list=[entropy_np, kl_np]) fetch_list=[entropy_np, kl_np])
np.testing.assert_allclose( np.testing.assert_allclose(
output_entropy_np, gt_entropy_np, rtol=tolerance) output_entropy_np, gt_entropy_np, rtol=tolerance, atol=tolerance)
np.testing.assert_allclose(output_kl_np, gt_kl_np, rtol=tolerance) np.testing.assert_allclose(
output_kl_np, gt_kl_np, rtol=tolerance, atol=tolerance)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册