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

Function _process_edges

python/dgl/subgraph.py:315–321  ·  view source on GitHub ↗
(etype, e)

Source from the content-addressed store, hash-verified

313 edges = {graph.canonical_etypes[0]: edges}
314
315 def _process_edges(etype, e):
316 if F.is_tensor(e) and F.dtype(e) == F.bool:
317 return F.astype(
318 F.nonzero_1d(F.copy_to(e, graph.device)), graph.idtype
319 )
320 else:
321 return utils.prepare_tensor(graph, e, 'edges["{}"]'.format(etype))
322
323 edges = {graph.to_canonical_etype(etype): e for etype, e in edges.items()}
324 edges = {etype: _process_edges(etype, e) for etype, e in edges.items()}

Callers 1

edge_subgraphFunction · 0.85

Calls 4

formatMethod · 0.80
dtypeMethod · 0.45
astypeMethod · 0.45
copy_toMethod · 0.45

Tested by

no test coverage detected