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