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

28 lines
1.3 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.baddbmm
=====================
.. py:function:: mindspore.ops.baddbmm(x, batch1, batch2, beta=1, alpha=1)
对输入的两个三维矩阵batch1与batch2相乘并将结果与x相加。
计算公式定义如下:
.. math::
\text{out}_{i} = \beta \text{x}_{i} + \alpha (\text{batch1}_{i} \mathbin{@} \text{batch2}_{i})
参数:
- **x** (Tensor) - 输入Tensorshape为 :math:`(C, W, H)`
- **batch1** (Tensor) - 输入Tensorshape为 :math:`(C, W, T)`
- **batch2** (Tensor) - 输入Tensorshape为 :math:`(C, T, H)`
- **beta** (Union[float, int],可选) - `x` 的系数默认值为1。
- **alpha** (Union[float, int],可选) - :math:`batch1 @ batch2` 的系数默认值为1。
返回:
Tensor其数据类型与 `x` 相同,其维度与 `batch1@batch2` 的结果相同。
异常:
- **TypeError** - `x``batch1``batch2` 的类型不是Tensor。
- **TypeError** - `x``batch1``batch2` 数据类型不一致。
- **TypeError** - 对于输入为浮点类型的Tensor `beta``alpha` 不是实数。否则, `beta``alpha` 不是整数。
- **TypeError** - `beta``alpha` 不是实数类型。
- **ValueError** - `batch1``batch2` 的不是三维Tensor。