code: def scipy2tensor(spmat, idtype):
      """Function to convert a scipy matrix to a sparse adjacency matrix tuple.
  
      Note that the data array of the scipy matrix is discarded.
  
      Parameters
      ----------
      spmat : scipy.sparse.spmatrix
          SciPy sparse matrix.
      idtype : int32, int64, optional
          Integer ID type. Must be int32 or int64.
  
      Returns
      -------
      (str, tuple[Tensor])
          A tuple containing the format as well as the list of tensors representing
          the sparse matrix.
      """
      if spmat.format in ["csr", "csc"]:
          indptr = F.tensor(spmat.indptr, idtype)
          indices = F.tensor(spmat.indices, idtype)
          data = F.tensor([], idtype)
          return SparseAdjTuple(spmat.format, (indptr, indices, data))
      else:
          spmat = spmat.tocoo()
          row = F.tensor(spmat.row, idtype)
          col = F.tensor(spmat.col, idtype)
          return SparseAdjTuple("coo", (row, col))
  
file_path: dgl/python/dgl/utils/data.py
imports: from collections import namedtuple
  import networkx
  import scipy
  from ..None import backend
  from ..base import DGLError
  from .None import checks
label_desc: Use image node_id 2 for calling a global function with example usage: scipy2tensor(spmat, idtype) and returns: SparseAdjTuple, SparseAdjTuple