mindspore/docs/api/api_python/mint/mindspore.mint.func_take.rst

20 lines
566 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.mint.take
===================
.. py:function:: mindspore.mint.take(input, index)
选取给定索引 `index` 处的 `input` 元素。
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **input** (Tensor) - 输入张量。
- **index** (LongTensor) - 输入张量的索引张量。
返回:
Tensorshape与索引的shape相同。
异常:
- **TypeError** - 如果 `input` 不是Tensor。
- **TypeError** - 如果 `index` 的数据类型不是long。