2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.ops.func_channel_shuffle.rst 984 Bytes
一键复制 编辑 原始数据 按行查看 历史
俞涵 提交于 2023-05-05 12:09 . modify format

mindspore.ops.channel_shuffle

.. py:function:: mindspore.ops.channel_shuffle(x, groups)

    将shape为 :math:`(*, C, H, W)` 的Tensor的通道划分成 :math:`g` 组,并按如下方式重新排列 :math:`(*, \frac{C}{g}, g, H*W)` ,同时保持原始Tensor的shape不变。

    参数:
        - **x** (Tensor) - 被划分输入Tensor。shape为 :math:`(*, C, H, W)` ,数据类型为float16, float32、int8、int16、int32、int64、uint8、uint16、uint32或uint64。
        - **groups** (int) - 通道划分数目。

    返回:
        Tensor,数据类型与 `x` 相同,shape为 :math:`(*, C, H, W)` 。

    异常:
        - **TypeError** - `x` 的数据类型不是float16, float32、int8、int16、int32、int64、uint8、uint16、uint32或uint64。
        - **TypeError** - `x` 的维度小于4。
        - **TypeError** - `groups` 不是正整数。
        - **ValueError** - `x` 的通道数不能被 `groups` 整除。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助