mindspore.ops.addmm
- mindspore.ops.addmm(input, mat1, mat2, *, beta=1, alpha=1)[source]
Multiply matrix mat1 and matrix mat2. The matrix input is added to the final result.
Note
If beta is 0, then input will be ignored.
- Parameters
- Keyword Arguments
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> m = mindspore.ops.ones((3, 3)) >>> arr1 = mindspore.tensor([[8., 7., 6.], [5., 4., 3.], [2., 1., 0.]]) >>> arr2 = mindspore.tensor([[5., 4., 3.], [2., 1., 0.], [8., 7., 6.]]) >>> output = mindspore.ops.addmm(m, arr1, arr2) >>> print(output) [[103. 82. 61.] [ 58. 46. 34.] [ 13. 10. 7.]]