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

25 lines
810 B
ReStructuredText
Raw 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.chunk
====================
.. py:function:: mindspore.ops.chunk(x, chunks, axis=0)
沿着指定轴 `axis` 将输入Tensor切分成 `chunks` 个sub-tensor。
.. note::
此函数返回的数量可能小于通过 `chunks` 指定的数量!
参数:
- **x** (Tensor) - 被切分的Tensor。
- **chunks** (int) - 要切分的sub-tensor数量。
- **axis** (int) - 指定需要分割的维度。默认值0。
返回:
tuple[Tensor]。
异常:
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `axis` 不是int类型。
- **ValueError** - 参数 `axis` 超出 :math:`(-x.dim, x.dim)` 范围。
- **TypeError** - `chunks` 不是int。
- **ValueError** - 参数 `chunks` 不是正数。