code: def to_torch_sparse_csc(spmat: SparseMatrix) -> torch.Tensor:
      """Creates a torch sparse csc tensor from a sparse matrix.
  
      Note that converting a sparse matrix to torch csc tensor could change the
      order of non-zero values.
  
      Parameters
      ----------
      spmat : SparseMatrix
          Sparse matrix
  
      Returns
      -------
      torch.Tensor
          Torch tensor with torch.sparse_csc layout
  
      Examples
      --------
  
      >>> indices = torch.tensor([[1, 2, 1], [2, 4, 3]])
      >>> val = torch.arange(3)
      >>> spmat = dglsp.spmatrix(indices, val)
      >>> dglsp.to_torch_sparse_csc(spmat)
      tensor(ccol_indices=tensor([0, 0, 0, 1, 2, 3]),
             row_indices=tensor([1, 1, 2]),
             values=tensor([0, 2, 1]), size=(3, 5), nnz=3,
             layout=torch.sparse_csc)
      """
      shape = spmat.shape
      if spmat.val.dim() > 1:
          shape += spmat.val.shape[1:]
      indptr, indices, value_indices = spmat.csc()
      val = spmat.val
      if value_indices is not None:
          val = val[value_indices]
      return torch.sparse_csc_tensor(indptr, indices, val, shape)
  
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 11 for calling a global function with example usage: to_torch_sparse_csc(spmat) and returns: torch