You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.nn.DistributedGradReducer.rst 745 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819
  1. mindspore.nn.DistributedGradReducer
  2. ===================================
  3. .. py:class:: mindspore.nn.DistributedGradReducer(parameters, mean=True, degree=None, fusion_type=1, group=GlobalComm.WORLD_COMM_GROUP)
  4. 分布式优化器。
  5. 用于数据并行模式中,对所有卡的梯度利用AllReduce进行聚合。
  6. **参数:**
  7. - **parameters** (list) - 需要更新的参数。
  8. - **mean** (bool) - 当mean为True时,对AllReduce之后的梯度求均值。默认值:False。
  9. - **degree** (int) - 平均系数,通常等于设备编号。默认值:None。
  10. - **fusion_type** (int) - AllReduce算子的融合类型。默认值:1。
  11. **异常:**
  12. **ValueError**:如果degree不是int或小于0。