MCPcopy Index your code
hub / github.com/TorchSSL/TorchSSL / load_model

Method load_model

models/fixmatch/fixmatch.py:285–294  ·  view source on GitHub ↗
(self, load_path)

Source from the content-addressed store, hash-verified

283 self.print_fn(f"model saved: {save_filename}")
284
285 def load_model(self, load_path):
286 checkpoint = torch.load(load_path)
287
288 self.model.load_state_dict(checkpoint['model'])
289 self.ema_model = deepcopy(self.model)
290 self.ema_model.load_state_dict(checkpoint['ema_model'])
291 self.optimizer.load_state_dict(checkpoint['optimizer'])
292 self.scheduler.load_state_dict(checkpoint['scheduler'])
293 self.it = checkpoint['it']
294 self.print_fn('model loaded')
295
296 def interleave_offsets(self, batch, nu):
297 groups = [batch // (nu + 1)] * (nu + 1)

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected