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

28 lines
1.2 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.ops.addbmm
=====================
.. py:function:: mindspore.ops.addbmm(input, batch1, batch2, *, beta=1, alpha=1)
`batch1``batch2` 中的矩阵相乘,按照第一维度累计相加,再与 `input` 相加。
.. note::
- `batch1``batch2` 必须是三维的tensor且包含相同数量的矩阵。
- 如果 `batch1` 是大小为 :math:`(C, W, T)` 的tensor `batch2` 是大小为 :math:`(C, T, H)` 的tensor
`input` 必须能够与大小为 :math:`(W, H)` 的tensor进行广播且输出将是大小为 :math:`(W, H)` 的tensor。
-`beta` 为0那么 `input` 将会被忽略。
.. math::
output = \beta input + \alpha (\sum_{i=0}^{b-1} {batch1_i @ batch2_i})
参数:
- **input** (Tensor) - 输入tensor。
- **batch1** (Tensor) - 第一个将被乘batch矩阵。
- **batch2** (Tensor) - 第二个将被乘batch矩阵。
关键字参数:
- **beta** (Union[int, float],可选) - `input` 的尺度因子。默认 ``1``
- **alpha** (Union[int, float],可选) - `batch1` @ `batch2` )的尺度因子。默认 ``1``
返回:
Tensor