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

Method get_unitgraph

python/dgl/heterograph_index.py:1058–1077  ·  view source on GitHub ↗

Create a unitgraph graph from given edge type and copy to the given device context. Note: this internal function is for DGL scheduler use only Parameters ---------- etype : int If the graph index is a Bipartite graph index, this argument must be

(self, etype, ctx)

Source from the content-addressed store, hash-verified

1056 return _CAPI_DGLHeteroEdgeSubgraph(self, eids, preserve_nodes)
1057
1058 def get_unitgraph(self, etype, ctx):
1059 """Create a unitgraph graph from given edge type and copy to the given device
1060 context.
1061
1062 Note: this internal function is for DGL scheduler use only
1063
1064 Parameters
1065 ----------
1066 etype : int
1067 If the graph index is a Bipartite graph index, this argument must be None.
1068 Otherwise, it represents the edge type.
1069 ctx : DGLContext
1070 The context of the returned graph.
1071
1072 Returns
1073 -------
1074 HeteroGraphIndex
1075 """
1076 g = self.get_relation_graph(etype)
1077 return g.copy_to(ctx).asbits(self.bits_needed(etype or 0))
1078
1079 def get_csr_shuffle_order(self, etype):
1080 """Return the edge shuffling order when a coo graph is converted to csr format

Callers

nothing calls this directly

Calls 4

get_relation_graphMethod · 0.95
bits_neededMethod · 0.95
asbitsMethod · 0.45
copy_toMethod · 0.45

Tested by

no test coverage detected