Addmm
torch_addmm(self, mat1, mat2, beta = 1L, alpha = 1L)
self
: (Tensor) matrix to be addedmat1
: (Tensor) the first matrix to be multipliedmat2
: (Tensor) the second matrix to be multipliedbeta
: (Number, optional) multiplier for input
()alpha
: (Number, optional) multiplier for ()Performs a matrix multiplication of the matrices mat1
and mat2
. The matrix input
is added to the final result.
If mat1
is a tensor, mat2
is a tensor, then input
must be broadcastable with a tensor and out
will be a tensor.
alpha
and beta
are scaling factors on matrix-vector product between mat1
and mat2
and the added matrix input
respectively.
For inputs of type FloatTensor
or DoubleTensor
, arguments beta
and alpha
must be real numbers, otherwise they should be integers.
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) }
Useful links