torch.baddbmm
-
torch.baddbmm(input, batch1, batch2, *, beta=1, alpha=1, out=None) → Tensor -
Performs a batch matrix-matrix product of matrices in
batch1andbatch2.inputis added to the final result.batch1andbatch2must be 3-D tensors each containing the same number of matrices.If
batch1is a tensor,batch2is a tensor, theninputmust be broadcastable with a tensor andoutwill be a tensor. Bothalphaandbetamean the same as the scaling factors used intorch.addbmm().If
betais 0, theninputwill be ignored, andnanandinfin it will not be propagated.For inputs of type
FloatTensororDoubleTensor, argumentsbetaandalphamust be real numbers, otherwise they should be integers.This operator supports TensorFloat32.
- Parameters
- Keyword Arguments
-
-
beta (Number, optional) – multiplier for
input( ) - alpha (Number, optional) – multiplier for ( )
- out (Tensor, optional) – the output tensor.
-
beta (Number, optional) – multiplier for
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])
© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.baddbmm.html