News for hackers. Stuff that matters.
Re:Einstein Summation in Numpy by singularity2001 on Wednesday January 23, 2019 @10:53AM (#18979245)
For all of the listed applications there is a cleaner function in numpy (and tensorflow, right?)

    Vector inner product: "a,a->" (Assumes two vectors of same length)
    Vector element-wise product: "a,a->a" (Assumes two vectors of same length)
    Vector outer product: "a,b->ab" (Vectors not necessarily same length.)
    Matrix transposition: "ab->ba"
    Matrix diagonal: "ii->i"
    Matrix trace: "ii->"
    1-D Sum: "a->"
    2-D Sum: "ab->"
    3-D Sum: "abc->"
    Matrix inner product "ab,ab->" (If you pass twice the same argument, it becomes a matrix L2 norm)
    Left-multiplication Matrix-Vector: "ab,b->a"
    Right-multiplication Vector-Matrix: "a,ab->b"
    Matrix Multiply: "ab,bc->ac"
    Batch Matrix Multiply: "Yab,Ybc->Yac"
    Quadratic form / Mahalanobis Distance: "a,ab,b->"
Re:Einstein Summation in Numpy by blt on Thursday January 24, 2019 @01:15AM (#18986398)
Sure. The point of those examples is to use familiar operations to help the reader understand how the notation works, and show the generality.