From b31e763d7e019be3fca86e4bc9e1a81c68cca701 Mon Sep 17 00:00:00 2001 From: lilei Date: Thu, 24 Jun 2021 10:46:11 +0800 Subject: [PATCH] modify seed API --- mindspore/common/seed.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mindspore/common/seed.py b/mindspore/common/seed.py index d0850ffa73c..5da3fbe8a3d 100644 --- a/mindspore/common/seed.py +++ b/mindspore/common/seed.py @@ -157,7 +157,10 @@ def set_seed(seed): def get_seed(): """ - Get global random seed. + Get global seed. + + Returns: + Integer. The global seed. """ return _GLOBAL_SEED @@ -168,8 +171,11 @@ def _truncate_seed(seed): Args: seed (int): The seed to be truncated. + + Returns: + Integer. The seed with MAXINT32. """ - return seed % _MAXINT32 # Truncate to fit into 32-bit integer + return seed % _MAXINT32 def _update_seeds(op_seed, kernel_name):