2.5K Star 8.4K Fork 4.7K

GVPMindSpore/mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.ops.func_chunk.rst 847 Bytes
一键复制 编辑 原始数据 按行查看 历史
wind-zyx 提交于 2023-04-20 20:21 . ops update value format 0420

mindspore.ops.chunk

.. py:function:: mindspore.ops.chunk(input, chunks, axis=0)

    沿着指定轴 `axis` 将输入Tensor切分成 `chunks` 个sub-tensor。

    .. note::
        此函数返回的数量可能小于通过 `chunks` 指定的数量!

    参数:
        - **input** (Tensor) - 被切分的Tensor。
        - **chunks** (int) - 要切分的sub-tensor数量。
        - **axis** (int,可选) - 指定需要分割的维度。默认值: ``0`` 。

    返回:
        tuple[Tensor]。

    异常:
        - **TypeError** - `input` 不是Tensor。
        - **TypeError** - `axis` 不是int类型。
        - **TypeError** - `chunks` 不是int。
        - **ValueError** - 参数 `axis` 超出 :math:`[-input.ndim, input.ndim)` 范围。
        - **ValueError** - 参数 `chunks` 不是正数。
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3.q1

搜索帮助