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

31 lines
1.3 KiB
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.mint.addbmm
=====================
.. py:function:: mindspore.mint.addbmm(input, batch1, batch2, *, beta=1, alpha=1)
`batch1``batch2` 应用批量矩阵乘法后进行归约加, `input` 和最终的结果相加。
`alpha``batch1``batch2` 矩阵乘法的乘数, `beta``input` 的乘数。如果 `beta` 是0那么 `input` 将会被忽略。
.. math::
output = \beta input + \alpha (\sum_{i=0}^{b-1} {batch1_i @ batch2_i})
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **input** (Tensor) - 被添加的Tensor。
- **batch1** (Tensor) - 矩阵乘法中的第一个Tensor。
- **batch2** (Tensor) - 矩阵乘法中的第二个Tensor。
关键字参数:
- **beta** (Union[int, float],可选) - `input` 的乘数。默认值: ``1``
- **alpha** (Union[int, float],可选) - `batch1` @ `batch2` 的乘数。默认值: ``1``
返回:
Tensor`input` 具有相同的dtype。
异常:
- **TypeError** - 如果 `alpha` `beta` 不是int或者float。
- **ValueError** - 如果 `batch1` `batch2` 不能进行批量矩阵乘法。
- **ValueError** - 如果 `batch1``batch2` 的不是三维Tensor。