mindspore.ops.communication.P2POp =================================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://atomgit.com/mindspore/mindspore/blob/master/docs/api/api_python/ops/mindspore.ops.communication.P2POp.rst :alt: 查看源文件 .. py:class:: mindspore.ops.communication.P2POp(op, tensor, peer, group=None, tag=0) 用于存放关于 ``'isend'`` 、 ``'irecv'`` 相关的信息,并用于 `batch_isend_irecv` 接口的入参。 .. note:: 当 `op` 入参为 ``'irecv'`` 时,入参 `tensor` 会原地修改。 参数: - **op** (Union[str, function]) - 对于字符串类型,只允许 ``'isend'`` 和 ``'irecv'`` 。对于函数类型,只允许 ``ops.communication.isend`` 和 ``ops.communication.irecv`` 函数。 - **tensor** (Tensor) - 用于发送或接收的张量。 - **peer** (int) - 发送或接收的远程设备的全局编号。 - **group** (str,可选) - 工作的通信组,默认值: ``None`` (即Ascend平台为 ``"hccl_world_group"``)。 - **tag** (int,可选) - 当前暂不支持。默认值: ``0`` 。 返回: `P2POp` 对象。 异常: - **TypeError** - 当 `op` 不是与 ``'isend'`` 和 ``'irecv'`` 相关的字符串或函数。 - **TypeError** - 当 `tensor` 不是张量, `peer` 不是int。 - **NotImplementedError** - 当 `tag` 入参不为0。 样例: .. note:: .. include:: ../mint/mindspore.mint.comm_note.txt