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

Method __call__

python/dgl/transforms/module.py:1065–1081  ·  view source on GitHub ↗
(self, g)

Source from the content-addressed store, hash-verified

1063 self.keep_orig_edges = keep_orig_edges
1064
1065 def __call__(self, g):
1066 data_dict = dict()
1067
1068 for meta_etype, metapath in self.metapaths.items():
1069 meta_g = functional.metapath_reachable_graph(g, metapath)
1070 u_type = metapath[0][0]
1071 v_type = metapath[-1][-1]
1072 data_dict[(u_type, meta_etype, v_type)] = meta_g.edges()
1073
1074 if self.keep_orig_edges:
1075 for c_etype in g.canonical_etypes:
1076 data_dict[c_etype] = g.edges(etype=c_etype)
1077 new_g = update_graph_structure(g, data_dict, copy_edata=True)
1078 else:
1079 new_g = update_graph_structure(g, data_dict, copy_edata=False)
1080
1081 return new_g
1082
1083
1084class Compose(BaseTransform):

Callers

nothing calls this directly

Calls 3

update_graph_structureFunction · 0.85
itemsMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected