forked from mindspore-Ecosystem/mindspore
set_seed api fix in auto parallel mode
This commit is contained in:
parent
2534345459
commit
69af271f0f
|
@ -9,7 +9,7 @@ mindspore.set_seed
|
|||
- 全局种子可用于numpy.random, mindspore.common.Initializer, mindspore.ops.composite.random_ops以及mindspore.nn.probability.distribution。
|
||||
- 如果没有设置全局种子,这些包将会各自使用自己的种子,numpy.random和mindspore.common.Initializer将会随机选择种子值,mindspore.ops.composite.random_ops和mindspore.nn.probability.distribution将会使用零作为种子值。
|
||||
- numpy.random.seed()设置的种子仅能被numpy.random使用,而这个API设置的种子也可被numpy.random使用,因此推荐使用这个API设置所有的种子。
|
||||
- 在semi_auto_parallel/auto_parallel模式下,使用set_seed时,具有相同形状和相同切分策略的权重将被初始化为相同的结果,否则,将被初始化为不同的结果。
|
||||
- 在semi_auto_parallel/auto_parallel模式下,使用set_seed时,同一节点具有相同形状和相同切分策略的权重将被初始化为相同的结果,否则,将被初始化为不同的结果。
|
||||
|
||||
**参数:**
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ def set_seed(seed):
|
|||
numpy.random, so just set all seed by this API is recommended.
|
||||
|
||||
In semi_auto_parallel/auto_parallel mode, when using set_seed, weights with same shape and same sharding
|
||||
strategy would be initialized to the same result, otherwise, weights with same shape and same sharding strategy
|
||||
would be initialized to the different result.
|
||||
strategy in the same device would be initialized to the same result, otherwise, they would be initialized to
|
||||
the different result.
|
||||
|
||||
Args:
|
||||
seed (int): The seed to be set.
|
||||
|
|
Loading…
Reference in New Issue