forked from mindspore-Ecosystem/mindspore
!18800 Modify seed API
Merge pull request !18800 from lilei/modify_model_zoo_mass
This commit is contained in:
commit
0459e53040
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue