News for hackers. Stuff that matters.
Re:A basic introduction to NumPy's einsum by braised_babbage on Saturday April 09, 2022 @07:13PM (#30973048)
There are many evaluation strategies for tensor contractions; naively translating into nested for loops and then doing direct random-access arithmetic is just one approach. If you like numpy's einsum, a drop in replacement is https://optimized-einsum.readthedocs.io/en/stable/. In general, it's an open question as to how to best "compile" a tensor contraction expression into something executable, for several reasons (there are a lot of possible orderings for the contractions, if one wishes to rely on BLAS routines for efficient primitives one will find that they don't exactly fit the problem of tensor contraction like a glove, and so on).
Re:A basic introduction to NumPy's einsum by thrownawayalre on Saturday April 09, 2022 @07:20PM (#30973085)
The linked documentation states

    For example, the optimization of np.einsum has been passed upstream and most of the same features that can be found in this repository can be enabled with numpy.einsum(..., optimize=True). 
So numpy should provide the same perf for most cases.