From 38cd47370423b18522bc2a305b7e1bf8540a71f9 Mon Sep 17 00:00:00 2001 From: zhaoying9105 Date: Tue, 12 Jul 2022 12:31:02 +0800 Subject: [PATCH] [MLU]: set numpy random seed for test_hard_sigmoid_op_mlu.py and test_hard_swish_op_mlu.py (#44219) --- .../fluid/tests/unittests/mlu/test_hard_sigmoid_op_mlu.py | 3 ++- .../paddle/fluid/tests/unittests/mlu/test_hard_swish_op_mlu.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/mlu/test_hard_sigmoid_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_hard_sigmoid_op_mlu.py index a38c12c9004..5050e2006f3 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_hard_sigmoid_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_hard_sigmoid_op_mlu.py @@ -25,7 +25,8 @@ import paddle.fluid as fluid import paddle.nn.functional as F paddle.enable_static() -SEED = 2021 +SEED = 2022 +np.random.seed(SEED) def ref_hardsigmoid(x, slope=0.166666666666667, offset=0.5): diff --git a/python/paddle/fluid/tests/unittests/mlu/test_hard_swish_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_hard_swish_op_mlu.py index e0ae182b41d..89475eb6985 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_hard_swish_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_hard_swish_op_mlu.py @@ -25,7 +25,8 @@ import sys sys.path.append("..") paddle.enable_static() -SEED = 2020 +SEED = 2021 +np.random.seed(SEED) def scalarToType(val, data_type): -- GitLab