fn
addmv
→Tensoraddmv(input: Tensor, mat: Tensor, vec: Tensor, beta: float = ..., alpha: float = ...)Matrix-vector multiply with a scaled accumulator (BLAS-2 gemv).
Computes
,
the canonical BLAS-2 gemv operation.
Parameters
inputTensorAccumulator vector of shape
(M,).matTensorMatrix of shape
(M, N).vecTensorVector of shape
(N,).betafloatScalar multiplier on
input. Defaults to 1.0.alphafloatScalar multiplier on
mat @ vec. Defaults to 1.0.Returns
TensorVector of shape (M,).
Notes
Mathematical definition:
Implemented by promoting vec to a column (N, 1), calling
lucid.matmul, and squeezing the trailing axis.
Examples
>>> import lucid
>>> M = lucid.zeros(2)
>>> A = lucid.tensor([[1., 2.], [3., 4.]])
>>> v = lucid.tensor([5., 6.])
>>> lucid.addmv(M, A, v)
Tensor([17., 39.])