From 45e504a65b5c5e80f6161d88418805710d0a2701 Mon Sep 17 00:00:00 2001 From: lizhenyu Date: Tue, 27 Oct 2020 16:05:09 +0800 Subject: [PATCH] [bugfix]remove useless random seed update --- mindspore/common/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/common/tensor.py b/mindspore/common/tensor.py index 4add88b9cd0..21e03434a34 100644 --- a/mindspore/common/tensor.py +++ b/mindspore/common/tensor.py @@ -439,10 +439,10 @@ class MetaTensor(MetaTensor_): global_seed = get_seed() self._np_seed = np.random.get_state()[1][0] self.need_set_seed = ((slice_index is not None) and (global_seed is None)) - self.seed = self.init.seed def __enter__(self): if self.need_set_seed: + self.seed = self.init.seed np.random.seed(slice_index) self.init.seed = slice_index