未验证 提交 ab37c8e9 编写于 作者: S Shijie 提交者: GitHub

Fix random seed for test_distribution_* UTs (#45003)

上级 31909bb5
......@@ -23,6 +23,7 @@ import parameterize as param
from config import ATOL, RTOL
from parameterize import xrand
np.random.seed(2022)
paddle.enable_static()
......
......@@ -23,6 +23,8 @@ from paddle.fluid import layers
from test_distribution import DistributionNumpy
np.random.seed(2022)
class CategoricalNumpy(DistributionNumpy):
......
......@@ -21,6 +21,8 @@ from paddle.distribution import constraint
import config
import parameterize as param
np.random.seed(2022)
@param.param_cls((param.TEST_CASE_NAME, 'value'),
[('NotImplement', np.random.rand(2, 3))])
......
......@@ -22,6 +22,8 @@ import config
from config import ATOL, DEVICES, RTOL
import parameterize as param
np.random.seed(2022)
@param.place(DEVICES)
@param.param_cls(
......
......@@ -21,6 +21,7 @@ import scipy.stats
from config import ATOL, DEVICES, RTOL
from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand
np.random.seed(2022)
paddle.enable_static()
......
......@@ -22,6 +22,8 @@ import config
import mock_data as mock
import parameterize
np.random.seed(2022)
@parameterize.place(config.DEVICES)
@parameterize.parameterize_cls(
......
......@@ -22,6 +22,7 @@ import config
import mock_data as mock
import parameterize
np.random.seed(2022)
paddle.enable_static()
......
......@@ -21,6 +21,8 @@ import scipy.stats
import config
import parameterize as param
np.random.seed(2022)
@param.place(config.DEVICES)
@param.param_cls(
......
......@@ -21,6 +21,7 @@ import scipy.stats
import config
import parameterize as param
np.random.seed(2022)
paddle.enable_static()
......
......@@ -23,6 +23,8 @@ from paddle.fluid import layers
from test_distribution import DistributionNumpy
np.random.seed(2022)
class NormalNumpy(DistributionNumpy):
......
......@@ -22,6 +22,9 @@ from paddle.distribution import constraint, transform, variable
import config
import parameterize as param
np.random.seed(2022)
paddle.seed(2022)
@param.place(config.DEVICES)
class TestTransform(unittest.TestCase):
......
......@@ -21,6 +21,8 @@ from paddle.distribution import transform, variable, constraint
import config
import parameterize as param
np.random.seed(2022)
paddle.seed(2022)
paddle.enable_static()
......
......@@ -23,6 +23,8 @@ from paddle.fluid import layers
from test_distribution import DistributionNumpy
np.random.seed(2022)
class UniformNumpy(DistributionNumpy):
......
......@@ -22,6 +22,8 @@ from paddle.distribution import constraint
import config
import parameterize as param
paddle.seed(2022)
@param.param_cls(
(param.TEST_CASE_NAME, 'is_discrete', 'event_rank', 'constraint'),
......
......@@ -25,6 +25,8 @@ import config
import mock_data as mock
import parameterize as param
np.random.seed(2022)
paddle.seed(2022)
paddle.set_default_dtype('float64')
......
......@@ -25,6 +25,8 @@ import config
import parameterize as param
import mock_data as mock
np.random.seed(2022)
paddle.seed(2022)
paddle.enable_static()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册