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

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