torch.addmv¶
- torch.addmv(input, mat, vec, *, beta=1, alpha=1, out=None) Tensor¶
- Performs a matrix-vector product of the matrix - matand the vector- vec. The vector- inputis added to the final result.- If - matis a tensor,- vecis a 1-D tensor of size m, then- inputmust be broadcastable with a 1-D tensor of size n and- outwill be 1-D tensor of size n.- alphaand- betaare scaling factors on matrix-vector product between- matand- vecand the added tensor- inputrespectively.- If - betais 0, then- inputwill be ignored, and nan and inf in it will not be propagated.- For inputs of type FloatTensor or DoubleTensor, arguments - betaand- alphamust be real numbers, otherwise they should be integers.- Parameters
- Keyword Arguments
- beta (Number, optional) – multiplier for - input()
- alpha (Number, optional) – multiplier for () 
- out (Tensor, optional) – the output tensor. 
 
 - Example: - >>> M = torch.randn(2) >>> mat = torch.randn(2, 3) >>> vec = torch.randn(3) >>> torch.addmv(M, mat, vec) tensor([-0.3768, -5.5565])