torch.mv
- torch.mv(input, vec, *, out=None) → Tensor
Performs a matrix-vector product of the matrix
inputand the vector.
Performs a matrix-vector product of the matrix input and the vector
.
If input is a tensor, vec is a 1-D tensor of
size , out will be 1-D of size .
Example:
>>> mat = torch.randn(2, 3)
>>> vec = torch.randn(3)
>>> torch.mv(mat, vec)
tensor([ 1.0404, -0.6361])