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

26 lines
1.0 KiB
ReStructuredText
Raw Normal View History

2022-08-04 10:52:17 +08:00
mindspore.ops.Addcmul
========================
.. py:class:: mindspore.ops.Addcmul
2022-10-28 11:34:42 +08:00
执行Tensor `x1` 与Tensor `x2` 的逐元素乘积,将结果乘以标量值 `value` ,并将其添加到 `input_data` 中。
2022-08-04 10:52:17 +08:00
.. math::
output[i] = input\_data[i] + value[i] * (x1[i] * x2[i])
输入:
2022-10-28 11:34:42 +08:00
- **input_data** (Tensor) - 要添加的Tensor。
- **x1** (Tensor) - 要乘以的Tensor。
- **x2** (Tensor) - 要乘以的Tensor。
- **value** (Tensor) - Tensor x1*x2的乘数。
2022-08-04 10:52:17 +08:00
输出:
2022-10-28 11:34:42 +08:00
Tensor具有与x1*x2相同的shape和dtype。
2022-08-04 10:52:17 +08:00
异常:
2022-10-28 11:34:42 +08:00
- **TypeError** - 如果 `x1``x2``value``input_data` 不是Tensor。
2023-02-08 15:13:00 +08:00
- **TypeError** - 如果 `x1``x2``value``input_data` 的dtype不一致。
2022-10-28 11:34:42 +08:00
- **ValueError** - 如果无法将 `x1` 广播到 `x2`
- **ValueError** - 如果无法将 `value` 广播到 `x1` * `x2`
- **ValueError** - 如果无法将 `input_data` 广播到 `value*(x1*x2)`