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

17 lines
661 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.MaskedSelect
===========================
.. py:class:: mindspore.ops.MaskedSelect
返回一个一维张量,其中的内容是 `x` 张量中对应于 `mask` 张量中True位置的值。`mask` 的shape与 `x` 的shape不需要一样但必须符合广播规则。
输入:
- **x** (Tensor) - 它的shape是 :math:`(x_1, x_2, ..., x_R)`
- **mask** (Tensor[bool]) - 它的shape是 :math:`(x_1, x_2, ..., x_R)`
输出:
一维Tensor数据类型与 `x` 相同。
异常:
- **TypeError** - `x``mask` 不是Tensor。
- **TypeError** - `mask` 不是bool类型的Tensor。