A RetroSearch Logo

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

Search Query:

Showing content from https://docs.pytorch.org/docs/main/generated/torch.baddbmm.html below:

torch.baddbmm — PyTorch main documentation

Performs a batch matrix-matrix product of matrices in batch1 and batch2. input is added to the final result.

batch1 and batch2 must be 3-D tensors each containing the same number of matrices.

If batch1 is a ( b × n × m ) (b \times n \times m) (b×n×m) tensor, batch2 is a ( b × m × p ) (b \times m \times p) (b×m×p) tensor, then input must be broadcastable with a ( b × n × p ) (b \times n \times p) (b×n×p) tensor and out will be a ( b × n × p ) (b \times n \times p) (b×n×p) tensor. Both alpha and beta mean the same as the scaling factors used in torch.addbmm().

out i = β   input i + α   ( batch1 i @ batch2 i ) \text{out}_i = \beta\ \text{input}_i + \alpha\ (\text{batch1}_i \mathbin{@} \text{batch2}_i) outi=β inputi+α (batch1i@batch2i)

If beta is 0, then the content of input will be ignored, and nan and inf in it will not be propagated.

For inputs of type FloatTensor or DoubleTensor, arguments beta and alpha must be real numbers, otherwise they should be integers.

This operator supports TensorFloat32.

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

Parameters
Keyword Arguments

Example:

>>> M = torch.randn(10, 3, 5)
>>> batch1 = torch.randn(10, 3, 4)
>>> batch2 = torch.randn(10, 4, 5)
>>> torch.baddbmm(M, batch1, batch2).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