oneflow.mm¶
-
oneflow.mm(input, mat2) → Tensor¶ Performs a matrix multiplication of the matrices
inputandmat2.If
inputis a \((n \times m)\) tensor,mat2is a \((m \times p)\) tensor,outwill be a \((n \times p)\) tensor.Note
This function does not broadcast. For broadcasting matrix products, see
oneflow.matmul().The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.mm.html.
- Parameters
input (oneflow.Tensor) – the first matrix to be matrix multiplied
mat2 (oneflow.Tensor) – the second matrix to be matrix multiplied
- Returns
The result Tensor
- Return type
For example:
>>> import oneflow as flow >>> mat1 = flow.randn(2, 3) >>> mat2 = flow.randn(3, 3) >>> of_out = flow.mm(mat1, mat2) >>> of_out.shape oneflow.Size([2, 3])