Using @njit with numpy.tensordot

yeah, Numba does very well on pure-loop versions.

There’s no need to accept the answer like stackoverflow, just saying it worked for you is enough, in case someone has the same problem and sees the thread.