@Sam_Lerman torch.save internally uses python pickling to write the objects to the file. Pickling is not a single operation but there are multiple writes of various things like : Some pickling headers, various child objects present in the object you want to pickle. And if you are overwriting on the same location, you have opened those files in write mode so data will be lost, if it is interrupted mid way
If you want atomic operations during write, you need to use a temp location and transfer the file only on the success of the torch.save operation