MCPcopy
hub / github.com/dmlc/dgl / load

Method load

python/dgl/data/adapter.py:154–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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(

Callers 2

loadMethod · 0.45
loadMethod · 0.45

Calls 3

_set_split_indexMethod · 0.95
formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected