Open wangzhen0518 opened 3 months ago
sspaddmm
performs an addmm with the LHS of the matrix multiply (a
in your example) and the addition factor (c
in your example) expected sparse. The RHS of the multiply (b
in your example) should be dense. (see the docs here )
I don't know off the top of my head if we have a specific API for dense += sparse @ sparse
which you are trying to do here. We might have support for some combination of compressed layouts for the MM and a dense result.
In general though dispatch though addmm
will find the appropriate implementation to call for the combination of layouts for a
, b
, c
provided if it exists so I would suggest using that API and trying coo
, csr
and csc
layouts for a/b.
🐛 Describe the bug
I met an error
RuntimeError self.is_sparse() INTERNAL ASSERT FAILED at "../aten/src/ATen/native/SparseTensorUtils.h":28, please report a bug to PyTorch. _internal_get_SparseTensorImpl: not a sparse tensor
when running the following code.Versions
cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer @jcaip