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