code: def sub(A: SparseMatrix, B: SparseMatrix) -> SparseMatrix:
      r"""Elementwise subtraction for ``SparseMatrix``, equivalent to ``A - B``.
  
      Parameters
      ----------
      A : SparseMatrix
          Sparse matrix
      B : SparseMatrix
          Sparse matrix
  
      Returns
      -------
      SparseMatrix
          Sparse matrix
  
      Examples
      --------
      >>> indices = torch.tensor([[1, 0, 2], [0, 1, 2]])
      >>> val = torch.tensor([10, 20, 30])
      >>> A = dglsp.spmatrix(indices, val)
      >>> B = dglsp.diag(torch.arange(1, 4))
      >>> dglsp.sub(A, B)
      SparseMatrix(indices=tensor([[0, 0, 1, 1, 2],
                                   [0, 1, 0, 1, 2]]),
                   values=tensor([-1, 20, 10, -2, 27]),
                   shape=(3, 3), nnz=5)
      """
      return A - B
  
file_path: dgl/python/dgl/sparse/elementwise_op.py
imports: from typing import Union
  from .sparse_matrix import SparseMatrix
  from .utils import Scalar
label_desc: Use image node_id 2 for calling a global function with example usage: sub(A, B) and returns: unknown