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.bmm.html below:

torch.bmm — PyTorch 2.8 documentation

torch.bmm#
torch.bmm(input, mat2, out_dtype=None, *, out=None) Tensor#

Performs a batch matrix-matrix product of matrices stored in input and mat2.

input and mat2 must be 3-D tensors each containing the same number of matrices.

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

out i = input i @ mat2 i \text{out}_i = \text{input}_i \mathbin{@} \text{mat2}_i outi=inputi@mat2i

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 batch of matrices to be multiplied

  • mat2 (Tensor) – the second batch of matrices to be multiplied

  • out_dtype (dtype, optional) – the dtype of the output tensor, Supported only on CUDA and for torch.float32 given torch.float16/torch.bfloat16 input dtypes

Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> input = torch.randn(10, 3, 4)
>>> mat2 = torch.randn(10, 4, 5)
>>> res = torch.bmm(input, mat2)
>>> res.size()
torch.Size([10, 3, 5])

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