I used iPython cells. and you can run any cell you like when you like.
This was the trick you need to have torch.manual_seed(0) in front of the command:
m = MyModel(vocab_size, n_fac).to("cuda").
Just having torch.manual_seed(0)  at the very start is not enough. because eny time you run the cell with m = MyModel(vocab_size, n_fac).to("cuda") you will have different parameters at startup.