Shouldn't `np.vdot` be even faster? For the contiguous case (when `.ravel()` would not copy) that might also apply for the 2-dim case.