forked from mindspore-Ecosystem/mindspore
28 lines
1.2 KiB
ReStructuredText
28 lines
1.2 KiB
ReStructuredText
|
|
mindspore.ops.addcmul
|
|||
|
|
======================
|
|||
|
|
|
|||
|
|
.. py:function:: mindspore.ops.addcmul(input_data, x1, x2, value)
|
|||
|
|
|
|||
|
|
执行Tensor `x1` 与Tensor `x2` 的逐元素乘积,将结果乘以标量值 `value` ,并将其添加到 `input_data` 中。
|
|||
|
|
|
|||
|
|
.. math::
|
|||
|
|
output[i] = input\_data[i] + value[i] * (x1[i] * x2[i])
|
|||
|
|
|
|||
|
|
参数:
|
|||
|
|
- **input_data** (Tensor) - 要添加的Tensor。
|
|||
|
|
- **x1** (Tensor) - 要乘以的Tensor。
|
|||
|
|
- **x2** (Tensor) - 要乘以的Tensor。
|
|||
|
|
- **value** (Tensor) - Tensor x1*x2的乘数。
|
|||
|
|
|
|||
|
|
返回:
|
|||
|
|
Tensor,具有与x1*x2相同的shape和dtype。
|
|||
|
|
|
|||
|
|
异常:
|
|||
|
|
- **TypeError** - 如果 `x1` 、 `x2` 、 `value` 、 `input_data` 不是Tensor。
|
|||
|
|
- **TypeError** - 如果 `input_data` 的dtype不是:float32、float16、int32之一。
|
|||
|
|
- **TypeError** - 如果 `x1` 或 `x2` 的dtype不是:float32、float16、int32之一.
|
|||
|
|
- **TypeError** - 如果 `value` 的dtype不是:float32、float16、int32之一。
|
|||
|
|
- **ValueError** - 如果无法将 `x1` 广播到 `x2` 。
|
|||
|
|
- **ValueError** - 如果无法将 `value` 广播到 `x1` * `x2` 。
|
|||
|
|
- **ValueError** - 如果无法将 `input_data` 广播到 `value*(x1*x2)` 。
|