class_docstr: Class for sparse matrix.
class_docstr_tok: ["Class","for","sparse","matrix","."]
docstr: Moves the matrix to CPU. If the matrix is already on CPU, the
  original matrix will be returned.
  
  Returns
  -------
  SparseMatrix
      The matrix on CPU
  
  Examples
  --------
  
  >>> indices = torch.tensor([[1, 1, 2], [1, 2, 0]]).to("cuda")
  >>> A = dglsp.spmatrix(indices, shape=(3, 4))
  
  >>> A.cpu()
  SparseMatrix(indices=tensor([[1, 1, 2],
                               [1, 2, 0]]),
               values=tensor([1., 1., 1.]),
               shape=(3, 4), nnz=3)
docstr_tok: ["Moves","the","matrix","to","CPU",".","If","the","matrix","is","already","on","CPU",",","the","original","matrix","will","be","returned",".","Returns","--","--","--","-","SparseMatrix","The","matrix","on","CPU","Examples","--","--","--","--",">",">",">","indices","=","torch.tensor","(","[","[","1",",","1",",","2","]",",","[","1",",","2",",","0","]","]",")",".to","(","``","cuda","''",")",">",">",">","A","=","dglsp.spmatrix","(","indices",",","shape=","(","3",",","4",")",")",">",">",">","A.cpu","(",")","SparseMatrix","(","indices=tensor","(","[","[","1",",","1",",","2","]",",","[","1",",","2",",","0","]","]",")",",","values=tensor","(","[","1.",",","1.",",","1",".","]",")",",","shape=","(","3",",","4",")",",","nnz=3",")"]
code: def cpu(self):
      """Moves the matrix to CPU. If the matrix is already on CPU, the
      original matrix will be returned.
  
      Returns
      -------
      SparseMatrix
          The matrix on CPU
  
      Examples
      --------
  
      >>> indices = torch.tensor([[1, 1, 2], [1, 2, 0]]).to("cuda")
      >>> A = dglsp.spmatrix(indices, shape=(3, 4))
  
      >>> A.cpu()
      SparseMatrix(indices=tensor([[1, 1, 2],
                                   [1, 2, 0]]),
                   values=tensor([1., 1., 1.]),
                   shape=(3, 4), nnz=3)
      """
      return self.to(device="cpu")
  
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 20 for calling the SparseMatrix obj's underlying member method code with example usage: obj.cpu() and returns: self