I’m not sure, if this is a PyTorch-specific issue or rather a Python multiprocessing limitation or if it depends on the used Python interpreter/IDE.
Based on the description it seems that your Python interpreter reloads the source files after each change or at a specific interval.
Based on this post 2 it also seems to be a Windows-specific behavior.