(self, directory_path: str)
| 271 | return self._root.num_leaves |
| 272 | |
| 273 | def save(self, directory_path: str): |
| 274 | # Make sure the target directory exists |
| 275 | if not os.path.isdir(directory_path): |
| 276 | os.mkdir(directory_path) |
| 277 | # Save the model to the target directory |
| 278 | with open(directory_path + '/model.pth', 'wb') as f: |
| 279 | torch.save(self, f) |
| 280 | |
| 281 | def save_state(self, directory_path: str): |
| 282 | # Make sure the target directory exists |
no outgoing calls
no test coverage detected