Solved by taha in post #2 
              
              
                I found the answer by myself and keep the question for the future reference: 
Answer 1: out[:, i*K:(i+1)*K, :]. 
Answer 2: out.view(b, Cin, K, L-w+1).