Shortcuts

pypose.bmv

class pypose.bmv(input, vec, *, out=None)[source]

Performs batched matrix-vector product.

Parameters
  • input (Tensor) – matrices to be multiplied.

  • vec (Tensor) – vectors to be multiplied.

Returns

the output tensor.

Return type

out (Tensor)

Note

The input has to be a (\(\cdots\times n \times m\)) tensor, the vec has to be a (\(\cdots\times m\)) tensor, and out will be a (\(\cdots\times n\)) tensor. Different from torch.mv, which is not broadcast, this function is broadcast and supports batched product.

Example

>>> matrix = torch.randn(2, 1, 3, 2)
>>> vec = torch.randn(1, 2, 2)
>>> out = pp.bmv(matrix, vec)
>>> out.shape
torch.Size([2, 2, 3])

Docs

Access documentation for PyPose

View Docs

Tutorials

Get started with tutorials and examples

View Tutorials

Get Started

Find resources and how to start using pypose

View Resources