MCPcopy Index your code
hub / github.com/dmlc/dgl / get_graph

Method get_graph

python/dgl/data/graph_serialize.py:69–80  ·  view source on GitHub ↗

Get DGLGraph from GraphData

(self)

Source from the content-addressed store, hash-verified

67 return _CAPI_MakeGraphData(ghandle, node_tensors, edge_tensors)
68
69 def get_graph(self):
70 """Get DGLGraph from GraphData"""
71 ghandle = _CAPI_GDataGraphHandle(self)
72 hgi = _CAPI_DGLAsHeteroGraph(ghandle)
73 g = DGLGraph(hgi, ["_U"], ["_E"])
74 node_tensors_items = _CAPI_GDataNodeTensors(self).items()
75 edge_tensors_items = _CAPI_GDataEdgeTensors(self).items()
76 for k, v in node_tensors_items:
77 g.ndata[k] = F.zerocopy_from_dgl_ndarray(v)
78 for k, v in edge_tensors_items:
79 g.edata[k] = F.zerocopy_from_dgl_ndarray(v)
80 return g
81
82
83def save_graphs(filename, g_list, labels=None, formats=None):

Callers 15

load_graph_v2Function · 0.45
load_graph_v1Function · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45
track_timeFunction · 0.45

Calls 2

DGLGraphClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected