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

13 lines
651 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.MaskedFill
=========================
.. py:class:: mindspore.ops.MaskedFill
将掩码位置为True的位置填充指定的值。
.. note::
如果 `value` 是Python类型的浮点数则默认会转为float32类型。这种情况下`input_x` 为float16类型时在CPU和Ascend平台上`input_x` 会转为float32类型参与计算
并将结果类型转换到float16类型可能会造成一定性能损耗而在GPU平台上则会引起TypeError。因此建议 `value` 采用与 `input_x` 具有相同数据类型的Tensor。
更多参考详见 :func:`mindspore.ops.masked_fill`