set_seed api fix in auto parallel mode

This commit is contained in:
yao_yf 2022-06-01 20:18:39 +08:00
parent 2534345459
commit 69af271f0f
2 changed files with 3 additions and 3 deletions

View File

@ -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时同一节点具有相同形状和相同切分策略的权重将被初始化为相同的结果,否则,将被初始化为不同的结果。
**参数:**

View File

@ -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.