Skip to content

Commit

Permalink
[Cleanup][C-7]Replace Program.random_seed (#61519)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc authored Feb 4, 2024
1 parent 744554b commit cd99902
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions test/ipu/test_eval_model_ipu.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def _test_optimizer(self, run_ipu=True):
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):
Expand Down
3 changes: 1 addition & 2 deletions test/legacy_test/test_fused_attention_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
import paddle.incubate.nn.functional as incubate_f
import paddle.nn.functional as F
from paddle import tensor
from paddle.base.framework import default_main_program
from paddle.nn.layer.common import Dropout, Linear
from paddle.nn.layer.norm import LayerNorm
from paddle.nn.layer.transformer import _convert_attention_mask

default_main_program().random_seed = 42
paddle.seed(42)


class TestFusedAttentionOp(OpTest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import paddle
import paddle.incubate.nn.functional as incubate_f
from paddle.base.framework import default_main_program
from paddle.nn.layer.common import Dropout
from paddle.nn.layer.norm import LayerNorm

default_main_program().random_seed = 42
paddle.seed(42)


class TestFusedBiasDropoutResidualLayerNormOp(OpTest):
Expand Down

0 comments on commit cd99902

Please sign in to comment.