Rate this Page
★★★★★
torch.mv#
- torch.mv(input,vec,*,out=None)→Tensor#
Performs a matrix-vector product of the matrix
inputand the vectorvec.If
inputis a tensor,vecis a 1-D tensor ofsize,outwill be 1-D of size.Note
This function does notbroadcast.
- Parameters
- Keyword Arguments
out (Tensor,optional) – the output tensor.
Example:
>>>mat=torch.randn(2,3)>>>vec=torch.randn(3)>>>torch.mv(mat,vec)tensor([ 1.0404, -0.6361])
On this page