PyTorch
torch / torch
torch.mm¶
-
torch.
mm
(input, mat2, *, out=None) → Tensor¶ Performs a matrix multiplication of the matrices
input
andmat2
.If
input
is a (n×m) tensor,mat2
is a (m×p) tensor,out
will be a (n×p) tensor.Note
This function does not broadcast. For broadcasting matrix products, see
torch.matmul()
.This operator supports TensorFloat32.
- Parameters
- Keyword Arguments
out (Tensor, optional) – the output tensor.
Example:
>>> mat1 = torch.randn(2, 3) >>> mat2 = torch.randn(3, 3) >>> torch.mm(mat1, mat2) tensor([[ 0.4851, 0.5037, -0.3633], [-0.0760, -3.6705, 2.4784]])
此页内容是否对您有帮助
感谢反馈!