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

19 lines
635 B
ReStructuredText
Raw Permalink 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.slice
====================
.. py:function:: mindspore.ops.slice(input_x, begin, size)
根据指定shape对输入tensor进行切片。
.. note::
`begin` 的起始值为0`size` 的起始值为1。
如果 `size[i]` 为-1则维度i中的所有剩余元素都包含在切片中。这相当于 :math:`size[i] = input\_x.shape(i) - begin[i]`
参数:
- **input_x** (Tensor) - 输入tensor。
- **begin** (Union[tuple, list]) - 切片的起始位置,表示每个维度的偏移。
- **size** (Union[tuple, list]) - 切片的大小。
返回:
Tensor