MCPcopy
hub / github.com/THUDM/CogDL / from_dict

Method from_dict

cogdl/data/data.py:940–945  ·  view source on GitHub ↗

r"""Creates a data object from a python dictionary.

(dictionary)

Source from the content-addressed store, hash-verified

938
939 @staticmethod
940 def from_dict(dictionary):
941 r"""Creates a data object from a python dictionary."""
942 data = Graph()
943 for key, item in dictionary.items():
944 data[key] = item
945 return data
946
947 def nodes(self):
948 return torch.arange(self.num_nodes)

Callers 2

cloneMethod · 0.45
cloneMethod · 0.45

Calls 1

GraphClass · 0.85

Tested by

no test coverage detected