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

26 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.baddbmm
=====================
.. py:function:: mindspore.ops.baddbmm(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:`(C, W, H)` 的tensor进行广播且输出将是大小为 :math:`(C, W, H)` 的tensor。
-`beta` 为0那么 `input` 将会被忽略。
- 当输入的类型不是 `FloatTensor` 时,参数 `beta``alpha` 必须是整数。
.. math::
\text{out}_{i} = \beta \text{input}_{i} + \alpha (\text{batch1}_{i} \mathbin{@} \text{batch2}_{i})
参数:
- **input** (Tensor) - 输入tensor。
- **batch1** (Tensor) - 第一个batch矩阵。
- **batch2** (Tensor) - 第二个batch矩阵。
- **beta** (Union[float, int], 可选) - `input` 的尺度因子。默认 ``1``
- **alpha** (Union[float, int],可选) - `batch1` @ `batch2` )的尺度因子,默认 ``1``
返回:
Tensor