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

29 lines
1.3 KiB
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.MulNoNan
=======================
.. py:class:: mindspore.ops.MulNoNan
逐元素计算输入乘积。如果 `y` 为零,无论 `x` 取何值它都将返回0。
`x``y` 的输入遵循隐式类型转换规则使数据类型一致。输入必须是两个Tensor或一个Tensor和一个Scalar。当输入是两个Tensor时它们的shape可以被广播。当输入是一个Tensor和一个Scalar时Scalar只能是一个常量。
.. math::
output_{ij} = \begin{cases}
0, & y_{ij} = 0;\\
x_{ij} * y_{ij}, & otherwise.
\end{cases}
.. note::
`x``y` 的shape应该相同或者可以广播。如果 `y` 是NaN或为无限的并且 `x` 是0结果将是NaN。
输入:
- **x** (Union[Tensor]) - 第一个输入是Tensor其数据类型为int32、int64、float16、float32、float64、complex64、complex128或Scalar。
- **y** (Union[Tensor]) - 第二个输入是Tensor其数据类型为int32、int64、float16、float32、float64、complex64、complex128或Scalar。
输出:
Tensorshape与广播后的shape相同数据类型是两个输入中精度较高的类型。
异常:
- **TypeError** - 如果 `x``y` 都不是Tensor。