(self, model_dir)
| 167 | return |
| 168 | |
| 169 | def load(self, model_dir): |
| 170 | checkpoint = torch.load(model_dir, map_location=self.device) |
| 171 | if self.opt.is_train: |
| 172 | self.opt_encoder.load_state_dict(checkpoint['opt_encoder']) |
| 173 | self.encoder.load_state_dict(checkpoint['encoder'], strict=True) |
| 174 | return checkpoint['ep'], checkpoint.get('total_it', 0) |
| 175 | |
| 176 | def train(self, train_dataset): |
| 177 | rank, world_size = get_dist_info() |
no outgoing calls
no test coverage detected