Numpy's einsum only works with dense tensors.

Is there an alternative that also works with sparse tensors and linear operators?

For example, I might have a function f that computes matrix vector multiplications of the form $A^{-1}x$ for some matrix $A$. Numpy's einsum doesn't even allow


let alone


The same operations also don't work when $A$ is a sparse matrix (let alone a general sparse tensor).

While the LinearOperator support is more of a convenience question, the support for sparse tensors is crucial to me.


1 Answer 1


See the list at Wikipedia and answers to Fast, lightweight C++ tensor library for dimension-agnostic code. Especially taco seems to fit your needs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.