Solved by ptrblck in post #4 
              
              
                No, it’s not randomly and the example in the docs would show how the kernel size and stride is applied. 
To reconstruct the input, you could take a look at the nn.Unfold and nn.Fold docs.