Addmm
addmm(input, mat1, mat2, *, beta=1, alpha=1, out=NULL) -> Tensor
Performs a matrix multiplication of the matrices mat1
and mat2
.
The matrix input
is added to the final result.
If mat1
is a mat2
is a
input
must be
broadcastable with a out
will be a
alpha
and beta
are scaling factors on matrix-vector product between
mat1
and mat2
and the added matrix input
respectively.
FloatTensor
or DoubleTensor
, arguments beta
and
alpha
must be real numbers, otherwise they should be integers.
Examples
if (torch_is_installed()) {
M = torch_randn(c(2, 3))
mat1 = torch_randn(c(2, 3))
mat2 = torch_randn(c(3, 3))
torch_addmm(M, mat1, mat2)
}
#> torch_tensor
#> 1.3950 -0.6360 -0.5194
#> 0.4232 -2.0003 0.1454
#> [ CPUFloatType{2,3} ]