Assuming you would like to compare both models, you could create a mapping between their state_dicts and load one to the other. Once this is done, perform a forward pass using the same data and check the output. I don’t see the usage of dropout layers, but you might want to call model.eval() in case you are using layers, which change their behavior in training and validation runs.
If the forward pass matches, you could then compare the gradients of all parameters (using the previous mapping for the state_dicts) after the backward() operation.