mindspore.ops.mv

View Source On Gitee
mindspore.ops.mv(mat, vec)[source]

Multiplies matrix mat and vector vec.

If mat is a (N,M) tensor, vec is a 1-D M tensor, out will be a 1-D N tensor.

Parameters
  • mat (Tensor) – Input matrix.

  • vec (Tensor) – Input vector.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> output = mindspore.ops.mv(mindspore.tensor([[3., 4.], [1., 6.], [1., 3.]]), mindspore.tensor([1., 2.]))
>>> print(output)
[11. 13. 7.]