(self)
| 62 | print('save checkpoint to', checkpoint_path) |
| 63 | |
| 64 | def load_checkpoint(self): |
| 65 | if not os.path.exists(self.checkpoint_path): |
| 66 | return False |
| 67 | info = torch.load(self.checkpoint_path) |
| 68 | self.memory = info['memory'] |
| 69 | self.candidates = info['candidates'] |
| 70 | self.vis_dict = info['vis_dict'] |
| 71 | self.keep_top_k = info['keep_top_k'] |
| 72 | self.epoch = info['epoch'] |
| 73 | |
| 74 | print('load checkpoint from', self.checkpoint_path) |
| 75 | return True |
| 76 | |
| 77 | def is_legal(self, cand): |
| 78 | assert isinstance(cand, tuple) |
no test coverage detected