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

25 lines
1.0 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.addbmm
=====================
.. py:function:: mindspore.ops.addbmm(x, batch1, batch2, *, beta=1, alpha=1)
`batch1``batch2` 应用批量矩阵乘法后进行reduced add。矩阵 `x` 和最终的结果相加。
`alpha``beta` 分别是 `batch1``batch2` 矩阵乘法和 `x` 的乘数。如果 `beta` 是0那么 `x` 将会被忽略。
.. math::
output = \beta x + \alpha (\sum_{i=0}^{b-1} {batch1 @ batch2})
参数:
- **x** (Tensor) - 被添加的tensor。
- **batch1** (Tensor) - 矩阵乘法中的第一个张量。
- **batch2** (Tensor) - 矩阵乘法中的第二个张量。
关键字参数:
- **beta** (Union[int, float],可选) - `x` 的乘数。默认值1。
- **alpha** (Union[int, float],可选) - `batch1` @ `batch2` 的乘数。默认值1。
返回:
Tensor`x` 具有相同的dtype。
异常:
- **ValueError**If `batch1` `batch2` 不能进行批量矩阵乘法。