Solved by tom in post #2 
              
              
                You can split the channel dimension with a view/reshape and sum 
n,c,h,w = input.size()
res = input.reshape(n, c//k, k, h, w).sum(2)

Best regards 
Thomas