Do we still need `d.sum()` and `count_non_zero(d)` ?