!18800 Modify seed API

Merge pull request !18800 from lilei/modify_model_zoo_mass
This commit is contained in:
i-robot 2021-06-24 07:34:17 +00:00 committed by Gitee
commit 0459e53040
1 changed files with 8 additions and 2 deletions

View File

@ -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):