mindspore/docs/api/api_python/ops/mindspore.ops.AllGather.rst

29 lines
965 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.AllGather
========================
.. py:class:: mindspore.ops.AllGather(group=GlobalComm.WORLD_COMM_GROUP)
在指定的通信组中汇聚Tensor。
.. note::
集合中所有进程的Tensor必须具有相同的shape和格式。
参数:
- **group** (str) - 工作的通信组,默认值:"GlobalComm.WORLD_COMM_GROUP"即Ascend平台为"hccl_world_group"GPU平台为"nccl_world_group" )。
输入:
- **input_x** (Tensor) - AllGather的输入shape为 :math:`(x_1, x_2, ..., x_R)` 的Tensor。
输出:
Tensor如果组中的device数量为N则输出的shape为 :math:`(N, x_1, x_2, ..., x_R)`
异常:
- **TypeError** - `group` 不是str。
- **ValueError** - 调用进程的rank id大于本通信组的rank大小。
样例:
.. note::
.. include:: mindspore.ops.comm_note.rst
该样例需要在2卡环境下运行。