3 ms·
Aha. So it could be optimized into two tight loops. The linked wikipedia on pairwise says the numpy implementation is same speed as naive
by kardos 2y ago
Aha. So it could be optimized into two tight loops. The linked wikipedia on pairwise says the numpy implementation is same speed as naive
- orlp 2y agoNumpy also uses blocked pairwise summation, with a block size of 128: https://github.com/numpy/numpy/blob/a6e9dc7152098182b45ecd6effa15223890d663e/numpy/_core/src/umath/loops_utils.h.src#L55 https://github.com/numpy/numpy/blob/a6e9dc7152098182b45ecd6e... .