For what it’s worth, if you run a Python interactive session and do
torch.nn.Module.dump_patches = True
model=torch.load("mymodel.model")

…pytorch will save one or more *.patch files which you can read in a text editor. They read like a typical file diff, showing the differences between your current code and what was loaded. You can use the command-line tool “patch” if you want to automatically change your current source files to be the same as the the loaded code - or you can make any changes you feel are necessary manually based on the diff. Or just ignore the warning, if the diff looks like only superficial changes have been made.