load the graph list and the labels from disk
(self)
| 434 | ) |
| 435 | |
| 436 | def load(self): |
| 437 | """load the graph list and the labels from disk""" |
| 438 | graph_path = os.path.join(self.save_path, self.save_name + ".bin") |
| 439 | info_path = os.path.join(self.save_path, self.save_name + ".pkl") |
| 440 | graphs, _ = load_graphs(str(graph_path)) |
| 441 | |
| 442 | info = load_info(str(info_path)) |
| 443 | self._num_classes = info["num_classes"] |
| 444 | self._predict_category = info["predict_category"] |
| 445 | self._hg = graphs[0] |
| 446 | # For backward compatibility |
| 447 | if "label" not in self._hg.nodes[self.predict_category].data: |
| 448 | self._hg.nodes[self.predict_category].data[ |
| 449 | "label" |
| 450 | ] = self._hg.nodes[self.predict_category].data["labels"] |
| 451 | |
| 452 | def __getitem__(self, idx): |
| 453 | r"""Gets the graph object""" |
nothing calls this directly
no test coverage detected