(self, state_dict)
| 339 | return state_dict |
| 340 | |
| 341 | def load_state_dict(self, state_dict): |
| 342 | # sets our state dicts on the model and optimizer, now that we've loaded |
| 343 | set_state_dict( |
| 344 | self.model, |
| 345 | self.optimizer, |
| 346 | model_state_dict=state_dict['model'], |
| 347 | optim_state_dict=state_dict['optim'], |
| 348 | ) |
| 349 | if self.ema is not None: |
| 350 | set_state_dict( |
| 351 | self.ema, |
| 352 | model_state_dict=state_dict['ema'], |
| 353 | ) |
| 354 | |
| 355 | |
| 356 | class Timer: |
no outgoing calls
no test coverage detected