From 89d19f5ad64ad505c23a4e4caa0a7ba77757616c Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Cleanup=20random=5Fseed=20No.3?= =?UTF-8?q?=E3=80=8112-13=E3=80=91clean=20some=20`random=5Fseed`=20(#61074?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/ipu/test_weight_decay_ipu.py | 3 +-- .../dist_fleet_raw_program_optimizer_fuse_allreduce.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/ipu/test_weight_decay_ipu.py b/test/ipu/test_weight_decay_ipu.py index 8cf93fe5a4229..6991a20fc8c80 100644 --- a/test/ipu/test_weight_decay_ipu.py +++ b/test/ipu/test_weight_decay_ipu.py @@ -63,8 +63,7 @@ def exclude_fn(param): scope = paddle.static.Scope() main_prog = paddle.static.Program() startup_prog = paddle.static.Program() - main_prog.random_seed = self.SEED - startup_prog.random_seed = self.SEED + paddle.seed(self.SEED) np.random.seed(self.SEED) with paddle.static.scope_guard(scope): diff --git a/test/legacy_test/dist_fleet_raw_program_optimizer_fuse_allreduce.py b/test/legacy_test/dist_fleet_raw_program_optimizer_fuse_allreduce.py index 7f118af943d12..918a8819ee129 100644 --- a/test/legacy_test/dist_fleet_raw_program_optimizer_fuse_allreduce.py +++ b/test/legacy_test/dist_fleet_raw_program_optimizer_fuse_allreduce.py @@ -28,8 +28,7 @@ paddle.dataset.mnist.fetch() # Fix seed for test -base.default_startup_program().random_seed = 1 -base.default_main_program().random_seed = 1 +paddle.seed(1) def cnn_model(data):