Solved by ptrblck in post #2 
              
              
                Yes, they are identical. 
The only difference between them are of course the values of the parameters due to random initialization. 
If you want to use the same parameters, you could try the following: 
modelA = nn.Sequential(
    nn.Linear(9328, 100),
    nn.Sigmoid(),
    nn.Linear(100, 16),
    n…