(self, path)
| 30 | ema(self.model_ema, self.model, rate) |
| 31 | |
| 32 | def save(self, path): |
| 33 | os.makedirs(path, exist_ok=True) |
| 34 | torch.save(self.step, os.path.join(path, "step.pth")) |
| 35 | for key, val in self.__dict__.items(): |
| 36 | if key != "step" and val is not None: |
| 37 | torch.save(val.state_dict(), os.path.join(path, f"{key}.pth")) |
| 38 | |
| 39 | def load(self, path): |
| 40 | logging.info(f"load from {path}") |
no outgoing calls