From fcf262790c6c6a27714fe767c850948d52e52188 Mon Sep 17 00:00:00 2001 From: Charles-hit <56987902+Charles-hit@users.noreply.github.com> Date: Fri, 2 Dec 2022 14:45:19 +0800 Subject: [PATCH] fix unit test (#48624) fix test_primapi --- .../fluid/tests/unittests/autograd/test_primapi.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/autograd/test_primapi.py b/python/paddle/fluid/tests/unittests/autograd/test_primapi.py index beb971a4c1..3d1a156386 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_primapi.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_primapi.py @@ -677,16 +677,15 @@ where_wrap = lambda x, y: paddle.where(paddle.eye(3, 4) == 1, x, y) None, 'float32', ), - ('var', paddle.var, (np.random.rand(200, 324),), None, 'float32'), ( - 'var_with_axis', - lambda x: paddle.var(x, axis=1), - (np.random.rand(10, 20, 30),), + 'var', + lambda x: paddle.var(x, unbiased=False), + (np.random.rand(200, 324),), None, 'float32', ), ( - 'var_without_unbiased', + 'var_with_axis', lambda x: paddle.var(x, axis=1, unbiased=False), (np.random.rand(10, 20, 30),), None, @@ -694,7 +693,7 @@ where_wrap = lambda x, y: paddle.where(paddle.eye(3, 4) == 1, x, y) ), ( 'var_with_keepdim', - lambda x: paddle.var(x, axis=1, keepdim=True), + lambda x: paddle.var(x, axis=1, keepdim=True, unbiased=False), (np.random.rand(10, 20, 30),), None, 'float32', -- GitLab