Mona_Jalal:

Ideally I want the same code to run across two machines.


The best approach would be to use the same PyTorch release on both machines. If that’s not possible, and assuming you are using the GPU, use torch.cuda.amp.autocast.