The most straightforward way I can think of for the optimizers is using state_dict() and load_state_dict().
For the dataloader there isn’t a way. I guess the implicit recommendation is to start from a fresh epoch (you could play games there, too, like caching the permutation of items it is currently going through and the position), but what should e.g. len(dl) return?
Best regards
Thomas