(self)
| 152 | ) |
| 153 | |
| 154 | def load(self): |
| 155 | with open( |
| 156 | os.path.join(self.save_path, "info_{}.json".format(self.hash)), "r" |
| 157 | ) as f: |
| 158 | info = json.load(f) |
| 159 | if ( |
| 160 | info["split_ratio"] != self.split_ratio |
| 161 | or info["target_ntype"] != self.target_ntype |
| 162 | ): |
| 163 | raise ValueError( |
| 164 | "Provided split ratio is different from the cached file. " |
| 165 | "Re-process the dataset." |
| 166 | ) |
| 167 | self.split_ratio = info["split_ratio"] |
| 168 | self.target_ntype = info["target_ntype"] |
| 169 | self.num_classes = info["num_classes"] |
| 170 | gs, _ = utils.load_graphs( |
| 171 | os.path.join(self.save_path, "graph_{}.bin".format(self.hash)) |
| 172 | ) |
| 173 | self.g = gs[0] |
| 174 | self._set_split_index() |
| 175 | |
| 176 | def save(self): |
| 177 | utils.save_graphs( |
no test coverage detected