How do you a set a seed for weight initialization in the nn module?

Did you set the seed right before instantiating both models?

torch.manual_seed(seed)
modelA = MyModel()

torch.manual_seed(seed)
modelB = MyModel()
10 Likes