Skip to content

Commit

Permalink
fix seed
Browse files Browse the repository at this point in the history
  • Loading branch information
chen2016013 committed Jan 15, 2024
1 parent 523dcbe commit a3d8dcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions python/paddle/nn/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,10 @@ def dropout(
if in_dynamic_or_pir_mode():
if paddle.static.default_main_program().random_seed != 0:
seed = paddle.static.default_main_program().random_seed
if paddle.common_ops_import.default_main_program().random_seed != 0:
seed = (
paddle.common_ops_import.default_main_program().random_seed
)

out = _C_ops.dropout(
x,
Expand Down
1 change: 0 additions & 1 deletion python/paddle/pir/program_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def _lr_schedule_guard(self, is_with_opt=False):
program_attrs = {
"global_seed": global_seed,
"_seed": global_prog_seed,
"random_seed": None,
"_lr_schedule_guard": _lr_schedule_guard,
}

Expand Down

0 comments on commit a3d8dcf

Please sign in to comment.