dgl.to_cugraphο
- dgl.to_cugraph(g)[source]ο
 Convert a DGL graph to a
cugraph.Graphand return.- Parameters:
 g (DGLGraph) β A homogeneous graph.
- Returns:
 The converted cugraph graph.
- Return type:
 cugraph.Graph
Notes
The function only supports GPU graph input.
Examples
The following example uses PyTorch backend.
>>> import dgl >>> import cugraph >>> import torch
>>> g = dgl.graph((torch.tensor([1, 2]), torch.tensor([1, 3]))).to('cuda') >>> cugraph_g = g.to_cugraph() >>> cugraph_g.edges() src dst 0 2 3 1 1 1