Please replace this by `np.sum(m, axis=axis, dtype=np.intp)` or equivalent...