This function does exact same thing as torch.addmm() in the forward,
except that it supports backward for sparse COO and CSR matrix mat1 .
When mat1 is a COO tensor it must have sparse_dim = 2 .
Supports both CSR and COO storage formats.
Gradient support:
COO @ Dense : Backward is supported for both inputs. The gradient for the
sparse input is returned as a sparse COO tensor.
CSR @ Dense : Backward is supported for both inputs. The gradient for the
sparse input is returned as a sparse CSR tensor.
CSC/BSR/BSC @ Dense : Not supported.
Sparse @ Sparse (COO @ COO, CSR @ CSR): Forward works, but backward is
not supported.
Parameters:
mat (Tensor ) – a dense matrix to be added
mat1 (Tensor ) – a sparse matrix to be multiplied
mat2 (Tensor ) – a dense matrix to be multiplied
beta (Number , optional ) – multiplier for mat (β \beta β )
alpha (Number , optional ) – multiplier for m a t 1 @ m a t 2 mat1 @ mat2 ma t 1@ ma t 2 (α \alpha α )