2022-02-19 15:27:46 +08:00
|
|
|
|
mindspore.ops.Broadcast
|
|
|
|
|
|
========================
|
|
|
|
|
|
|
|
|
|
|
|
.. py:class:: mindspore.ops.Broadcast(root_rank, group=GlobalComm.WORLD_COMM_GROUP)
|
|
|
|
|
|
|
2022-04-01 17:41:48 +08:00
|
|
|
|
对输入数据整组广播。
|
2022-02-19 15:27:46 +08:00
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
集合中的所有进程的Tensor的shape和数据格式相同。
|
|
|
|
|
|
|
2022-07-22 14:07:38 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
- **root_rank** (int) - 表示发送源的进程编号。除发送数据的进程外,存在于所有进程中。
|
|
|
|
|
|
- **group** (str) - 表示通信域。默认值:"hccl_world_group"。
|
2022-02-19 15:27:46 +08:00
|
|
|
|
|
2022-07-22 14:07:38 +08:00
|
|
|
|
输入:
|
|
|
|
|
|
- **input_x** (Tensor) - Tensor的shape为 :math:`(x_1, x_2, ..., x_R)` 。
|
2022-02-19 15:27:46 +08:00
|
|
|
|
|
2022-07-22 14:07:38 +08:00
|
|
|
|
输出:
|
|
|
|
|
|
Tensor,shape与输入相同,即 :math:`(x_1, x_2, ..., x_R)` 。内容取决于 `root_rank` device的数据。
|
2022-02-19 15:27:46 +08:00
|
|
|
|
|
2022-07-22 14:07:38 +08:00
|
|
|
|
异常:
|
|
|
|
|
|
- **TypeError** - root_rank不是int或group不是str。
|