mindspore.ops.addmm

mindspore.ops.addmm(x, mat1, mat2, *, beta=1, alpha=1)[source]

Multiplies matrix mat1 and matrix mat2. The matrix x is added to the final result.

Parameters
  • x (Tensor) – Tensor to be added.

  • mat1 (Tensor) – The first tensor to be multiplied.

  • mat2 (Tensor) – The second tensor to be multiplied.

Keyword Arguments
  • beta (Union[int, float], optional) – Multiplier for x. Default: 1.

  • alpha (Union[int, float], optional) – Multiplier for mat1 @ mat2. Default: 1.

\[output = \beta x + \alpha (mat1 @ mat2)\]
Returns

Tensor, has the same dtype as x.

Raises

ValueError – If mat1, mat2 cannot apply matrix multiplication.

Supported Platforms:

Ascend GPU CPU