arbitrary 1D pooling for ND-tensor (CPU, step 1)