class_docstr: An abstract base class for implementing cugraph-ops message passing layers.
class_docstr_tok: ["An","abstract","base","class","for","implementing","cugraph-ops","message","passing","layers","."]
docstr: Returns a CSC representation of an :obj:`edge_index` tensor to be
  used as input to cugraph-ops conv layers.
  
  Args:
      edge_index (torch.Tensor): The edge indices.
      size ((int, int), optional). The shape of :obj:`edge_index` in each
          dimension. (default: :obj:`None`)
      edge_attr (torch.Tensor, optional): The edge features.
          (default: :obj:`None`)
docstr_tok: ["Returns","a","CSC","representation","of","an",":","obj",":","`","edge_index","`","tensor","to","be","used","as","input","to","cugraph-ops","conv","layers",".","Args",":","edge_index","(","torch.Tensor",")",":","The","edge","indices",".","size","(","(","int",",","int",")",",","optional",")",".","The","shape","of",":","obj",":","`","edge_index","`","in","each","dimension",".","(","default",":",":","obj",":","`","None","`",")","edge_attr","(","torch.Tensor",",","optional",")",":","The","edge","features",".","(","default",":",":","obj",":","`","None","`",")"]
code: def to_csc(
      edge_index: torch.Tensor,
      size: Optional[Tuple[int, int]] = None,
      edge_attr: Optional[torch.Tensor] = None,
  ) -> Union[
      Tuple[torch.Tensor, torch.Tensor, int],
      Tuple[Tuple[torch.Tensor, torch.Tensor, int], torch.Tensor],
  ]:
      r"""Returns a CSC representation of an :obj:`edge_index` tensor to be
      used as input to cugraph-ops conv layers.
  
      Args:
          edge_index (torch.Tensor): The edge indices.
          size ((int, int), optional). The shape of :obj:`edge_index` in each
              dimension. (default: :obj:`None`)
          edge_attr (torch.Tensor, optional): The edge features.
              (default: :obj:`None`)
      """
      if size is None:
          warnings.warn(
              f"Inferring the graph size from 'edge_index' causes "
              f"a decline in performance and does not work for "
              f"bipartite graphs. To suppress this warning, pass "
              f"the 'size' explicitly in '{__name__}.to_csc()'."
          )
          num_src_nodes = num_dst_nodes = int(edge_index.max()) + 1
      else:
          num_src_nodes, num_dst_nodes = size
  
      row, col = edge_index
      col, perm = torch_geometric.utils.index_sort(
          col, max_value=num_dst_nodes
      )
      row = row[perm]
  
      colptr = torch_geometric.utils.sparse.index2ptr(
          col, num_dst_nodes
      )
  
      if edge_attr is not None:
          return (row, colptr, num_src_nodes), edge_attr[perm]
  
      return row, colptr, num_src_nodes
  
file_path: cugraph/python/cugraph-pyg/cugraph_pyg/nn/conv/base.py
imports: import warnings
  from typing import Optional, Tuple, Union
  from cugraph.utilities.utils import import_optional
  from pylibcugraphops.pytorch import CSC, HeteroCSC
label_desc: Use image node_id 2 for calling the BaseConv obj's underlying member method code with example usage: obj.to_csc(edge_index, size, edge_attr) and returns: row,  colptr,  num_src_nodes, row,  colptr,  num_src_nodes,  edge_attr