
Last chance! 50% off unlimited learning
Sale ends in
Addmv
torch_addmv(self, mat, vec, beta = 1L, alpha = 1L)
(Tensor) vector to be added
(Tensor) matrix to be multiplied
(Tensor) vector to be multiplied
(Number, optional) multiplier for input
(
(Number, optional) multiplier for
Performs a matrix-vector product of the matrix mat
and
the vector vec
.
The vector input
is added to the final result.
If mat
is a vec
is a 1-D tensor of
size m
, then input
must be
broadcastable with a 1-D tensor of size n
and
out
will be 1-D tensor of size n
.
alpha
and beta
are scaling factors on matrix-vector product between
mat
and vec
and the added tensor input
respectively.
FloatTensor
or DoubleTensor
, arguments beta
and
alpha
must be real numbers, otherwise they should be integers
# NOT RUN {
if (torch_is_installed()) {
M = torch_randn(c(2))
mat = torch_randn(c(2, 3))
vec = torch_randn(c(3))
torch_addmv(M, mat, vec)
}
# }
Run the code above in your browser using DataLab