I'd like to relax this limitation and allow sums over arbitrary integer patches (obviously <= original array size). The method would be to zero pad each dimension which fails a residual check by the minimum necessary to allow the patch.