mindspore2022/docs/api/api_python/ops/mindspore.ops.MaskedSelect.rst

19 lines
615 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.MaskedSelect
===========================
.. py:class:: mindspore.ops.MaskedSelect
使用布尔掩码对输入进行选择得到一个新的一维Tensor。掩码Tensor和输入Tensor的shape不需要匹配但需支持广播。
**输入:**
- **x** (Tensor) - 需要进行索引操作的输入Tensor其shape为 :math:`(x_1, x_2, ..., x_R)`
- **mask** (Tensor[bool]) - 要进行索引的布尔掩码其shape为 :math:`(x_1, x_2, ..., x_R)`
**输出:**
一维Tensor数据类型与x相同。
**异常:**
- **TypeError** - `x` 不是Tensor。