4
$\begingroup$

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

np.einsum('ij,j',A,x)

let alone

np.einsum('ijkl,mj->imkl',X,A)

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.

$\endgroup$
2
$\begingroup$

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

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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