Загрузка
Performs a matrix multiplication of the matrices mat1 and mat2.
The matrix input is added to the final result.
If mat1 is a tensor, mat2 is a
tensor, then input must be
broadcastable with a tensor
and out will be a tensor.
alpha and beta are scaling factors on matrix-vector product between
mat1 and mat2 and the added matrix input respectively.
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 operation has support for arguments with sparse layouts. If
input is sparse the result will have the same layout and if out
is provided it must have the same layout as input.
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(2, 3)
>>> mat1 = torch.randn(2, 3)
>>> mat2 = torch.randn(3, 3)
>>> torch.
input (Tensor) – matrix to be added
mat1 (Tensor) – the first matrix to be matrix multiplied
mat2 (Tensor) – the second matrix to be matrix 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.