code: def to_cugraph(
      edge_index: Tensor,
      edge_weight: Optional[Tensor] = None,
      relabel_nodes: bool = True,
      directed: bool = True,
  ) -> Any:
      r"""Converts a graph given by :obj:`edge_index` and optional
      :obj:`edge_weight` into a :obj:`cugraph` graph object.
  
      Args:
          edge_index (torch.Tensor): The edge indices of the graph.
          edge_weight (torch.Tensor, optional): The edge weights of the graph.
              (default: :obj:`None`)
          relabel_nodes (bool, optional): If set to :obj:`True`,
              :obj:`cugraph` will remove any isolated nodes, leading to a
              relabeling of nodes. (default: :obj:`True`)
          directed (bool, optional): If set to :obj:`False`, the graph will be
              undirected. (default: :obj:`True`)
      """
      import cudf
      import cugraph
  
      g = cugraph.Graph(directed=directed)
      df = cudf.from_dlpack(to_dlpack(edge_index.t()))
  
      if edge_weight is not None:
          assert edge_weight.dim() == 1
          df["2"] = cudf.from_dlpack(to_dlpack(edge_weight))
  
      g.from_cudf_edgelist(
          df,
          source=0,
          destination=1,
          edge_attr="2" if edge_weight is not None else None,
          renumber=relabel_nodes,
      )
  
      return g
  
file_path: pytorch_geometric/torch_geometric/utils/convert.py
imports: from collections import defaultdict
  from typing import Any, Dict, Iterable, List, Literal, Optional, Tuple, Union
  import scipy.sparse
  import torch
  from torch import Tensor
  from torch.utils.dlpack import from_dlpack, to_dlpack
  import torch_geometric
  from torch_geometric.utils.num_nodes import maybe_num_nodes
label_desc: Use image node_id 9 for calling a global function with example usage: to_cugraph(edge_index, edge_weight, relabel_nodes, directed) and returns: g