oneflow.mv¶
-
oneflow.
mv
(input, vec) → Tensor¶ Performs a matrix-vector product of the matrix
input
and the vectorvec
.If
input
is a \((n \times m)\) tensor,vec
is a 1-D tensor of size m,out
will be a 1-D tensor of size n.Note
This function does not broadcast.
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.mv.html.
- Parameters
input (oneflow.Tensor) – matrix to be matrix multiplied
vec (oneflow.Tensor) – vector to be matrix multiplied
- Returns
the output Tensor
- Return type
For example:
>>> import oneflow as flow >>> mat = flow.randn(2, 3) >>> vec = flow.randn(3) >>> out = flow.mv(mat, vec) >>> out.shape oneflow.Size([2])