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

22 lines
700 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)
根据指定的轴将输入Tensor切分成块。
参数:
- **x** (Tensor) - Tensor的shape为 :math:`(x_1, x_2, ..., x_R)`
- **chunks** (int) - 要返回的块数。
- **axis** (int) - 指定分割轴。默认值0。
返回:
tuple[Tensor]。
异常:
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `axis` 不是int类型。
- **ValueError** - 参数 `axis` 超出 :math:`(-x.dim, x.dim)` 范围。
- **TypeError** - `chunks` 不是int。
- **ValueError** - 参数 `chunks` 不是正数。