[bugfix]remove useless random seed update

This commit is contained in:
lizhenyu 2020-10-27 16:05:09 +08:00
parent e3972c0a7c
commit 45e504a65b
1 changed files with 1 additions and 1 deletions

View File

@ -439,10 +439,10 @@ class MetaTensor(MetaTensor_):
global_seed = get_seed() global_seed = get_seed()
self._np_seed = np.random.get_state()[1][0] self._np_seed = np.random.get_state()[1][0]
self.need_set_seed = ((slice_index is not None) and (global_seed is None)) self.need_set_seed = ((slice_index is not None) and (global_seed is None))
self.seed = self.init.seed
def __enter__(self): def __enter__(self):
if self.need_set_seed: if self.need_set_seed:
self.seed = self.init.seed
np.random.seed(slice_index) np.random.seed(slice_index)
self.init.seed = slice_index self.init.seed = slice_index