Rate this Page

torch.sparse.addmm#

torch.sparse.addmm(mat,mat1,mat2,*,beta=1.,alpha=1.)Tensor#

This function does exact same thing astorch.addmm() in the forward,except that it supports backward for sparse COO matrixmat1.Whenmat1 is a COO tensor it must havesparse_dim = 2.When inputs are COO tensors, this function also supports backward for both inputs.

Supports both CSR and COO storage formats.

Note

This function doesn’t support computing derivatives with respect to CSR matrices.

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 format (β\beta)

  • alpha (Number,optional) – multiplier format1@mat2mat1 @ mat2 (α\alpha)