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

Method edge_ids

python/dgl/graph_index.py:330–357  ·  view source on GitHub ↗

Return a triplet of arrays that contains the edge IDs. Parameters ---------- u : utils.Index The src nodes. v : utils.Index The dst nodes. Returns ------- utils.Index The src nodes. utils.Index

(self, u, v)

Source from the content-addressed store, hash-verified

328 return utils.toindex(_CAPI_DGLGraphEdgeId(self, int(u), int(v)))
329
330 def edge_ids(self, u, v):
331 """Return a triplet of arrays that contains the edge IDs.
332
333 Parameters
334 ----------
335 u : utils.Index
336 The src nodes.
337 v : utils.Index
338 The dst nodes.
339
340 Returns
341 -------
342 utils.Index
343 The src nodes.
344 utils.Index
345 The dst nodes.
346 utils.Index
347 The edge ids.
348 """
349 u_array = u.todgltensor()
350 v_array = v.todgltensor()
351 edge_array = _CAPI_DGLGraphEdgeIds(self, u_array, v_array)
352
353 src = utils.toindex(edge_array(0))
354 dst = utils.toindex(edge_array(1))
355 eid = utils.toindex(edge_array(2))
356
357 return src, dst, eid
358
359 def find_edge(self, eid):
360 """Return the edge tuple of the given id.

Callers

nothing calls this directly

Calls 1

todgltensorMethod · 0.80

Tested by

no test coverage detected