Загрузка
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 tensor, batch2 is a
tensor, then input must be
broadcastable with a
tensor and out will be a
tensor. Both alpha and beta mean the
same as the scaling factors used in torch.addbmm().
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.
beta (Number, optional) – multiplier for input ()
Example:
>>> M = torch.randn(10, 3, 5)
>>> batch1 = torch.randn(10, 3, 4)
>>> batch2 = torch.randn(10, 4
input (Tensor) – the tensor to be added
batch1 (Tensor) – the first batch of matrices to be multiplied
batch2 (Tensor) – the second batch of matrices to be multiplied
out_dtype (dtype) – the dtype of the output tensor.
On CUDA and XPU, only torch.float32 is supported given
torch.float16/torch.bfloat16 input dtypes. Other backends
(including out-of-tree accelerators) may support additional
input/output dtype combinations.
alpha (Number, optional) – multiplier for ()
out (Tensor, optional) – the output tensor.
beta (Number, optional) – multiplier for input ()
alpha (Number, optional) – multiplier for ()
out (Tensor, optional) – the output tensor.