A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pytorch.org/docs/stable/generated/torch.mm.html below:

torch.mm — PyTorch 2.7 documentation

torch.mm
torch.mm(input, mat2, *, out=None) Tensor

Performs a matrix multiplication of the matrices input and mat2.

If input is a ( n × m ) (n \times m) (n×m) tensor, mat2 is a ( m × p ) (m \times p) (m×p) tensor, out will be a ( n × p ) (n \times p) (n×p) tensor.

Supports strided and sparse 2-D tensors as inputs, autograd with respect to strided inputs.

This operation has support for arguments with sparse layouts. If out is provided its layout will be used. Otherwise, the result layout will be deduced from that of input.

Warning

Sparse support is a beta feature and some layout(s)/dtype/device combinations may not be supported, or may not have autograd support. If you notice missing functionality please open a feature request.

This operator supports TensorFloat32.

On certain ROCm devices, when using float16 inputs this module will use different precision for backward.

Parameters
  • input (Tensor) – the first matrix to be matrix multiplied

  • mat2 (Tensor) – the second matrix to be matrix multiplied

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]])
Docs

Access comprehensive developer documentation for PyTorch

View Docs Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials Resources

Find development resources and get your questions answered

View Resources

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4