Why do we need state_dict = state_dict.copy()

This might be helpful: Cache = self.state_dict() overwritten - #6 by ptrblck