Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu committed Aug 28, 2020
1 parent 0a356fb commit d2ce796
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def train(conf_dict, to_static):

with fluid.dygraph.guard(place):
paddle.manual_seed(SEED)
paddle.framework.random._manual_program_seed(SEED)

conf_dict['dict_size'] = len(vocab)
conf_dict['seq_len'] = args.seq_len
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/fluid/tests/unittests/test_imperative_deepcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def test_deefcf(self):
(users_np, items_np, labels_np, num_users, num_items,
matrix) = get_data()
paddle.manual_seed(seed)
paddle.framework.random._manual_program_seed(seed)
startup = fluid.Program()
main = fluid.Program()

Expand Down Expand Up @@ -243,6 +244,7 @@ def test_deefcf(self):

with fluid.dygraph.guard():
paddle.manual_seed(seed)
paddle.framework.random._manual_program_seed(seed)

deepcf = DeepCF(num_users, num_items, matrix)
adam = fluid.optimizer.AdamOptimizer(
Expand All @@ -267,6 +269,7 @@ def test_deefcf(self):

with fluid.dygraph.guard():
paddle.manual_seed(seed)
paddle.framework.random._manual_program_seed(seed)

deepcf2 = DeepCF(num_users, num_items, matrix)
adam2 = fluid.optimizer.AdamOptimizer(
Expand Down
6 changes: 5 additions & 1 deletion python/paddle/fluid/tests/unittests/test_jit_save_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pickle
import unittest
import numpy as np

import paddle
from paddle.static import InputSpec
import paddle.fluid as fluid
from paddle.fluid.dygraph import Linear
Expand Down Expand Up @@ -109,6 +109,7 @@ def setUp(self):
fluid.enable_dygraph()
# config seed
paddle.manual_seed(SEED)
paddle.framework.random._manual_program_seed(SEED)

def train_and_save_model(self, model_path=None, configs=None):
layer = LinearNet(784, 1)
Expand Down Expand Up @@ -294,6 +295,7 @@ def setUp(self):
fluid.enable_dygraph()
# config seed
paddle.manual_seed(SEED)
paddle.framework.random._manual_program_seed(SEED)

def basic_save_load(self, layer, model_path, configs):
# 1. train & save
Expand Down Expand Up @@ -386,6 +388,7 @@ def setUp(self):
fluid.enable_dygraph()
# config seed
paddle.manual_seed(SEED)
paddle.framework.random._manual_program_seed(SEED)
# train and save base model
self.train_and_save_orig_model()

Expand Down Expand Up @@ -427,6 +430,7 @@ def setUp(self):
fluid.enable_dygraph()
# config seed
paddle.manual_seed(SEED)
paddle.framework.random._manual_program_seed(SEED)

def train_and_save(self):
train_layer = LinearNetReturnHidden(8, 8)
Expand Down

0 comments on commit d2ce796

Please sign in to comment.