code: def smin(input: SparseMatrix, dim: Optional[int] = None):
      """Computes the minimum of non-zero values of the :attr:`input` sparse
      matrix along the given dimension :attr:`dim`.
  
      The reduction does not count zero values. If the row or column to be reduced
      does not have any non-zero value, the result will be 0.
  
      Parameters
      ----------
      input : SparseMatrix
          The input sparse matrix
      dim : int, optional
          The dimension to reduce, must be either 0 (by rows) or 1 (by columns)
          or None (on both rows and columns simultaneously)
  
          If :attr:`dim` is None, it reduces both the rows and the columns
          in the sparse matrix, producing a tensor of shape
          ``input.val.shape[1:]``. Otherwise, it reduces on the row (``dim=0``)
          or column (``dim=1``) dimension, producing a tensor of shape
          ``(input.shape[1],) + input.val.shape[1:]`` or
          ``(input.shape[0],) + input.val.shape[1:]``.
  
      Returns
      ----------
      torch.Tensor
          Reduced tensor
  
      Examples
      ----------
  
      Case1: scalar-valued sparse matrix
  
      >>> indices = torch.tensor([[0, 1, 1], [0, 0, 2]])
      >>> val = torch.tensor([1, 1, 2])
      >>> A = dglsp.spmatrix(indices, val, shape=(4, 3))
      >>> dglsp.smin(A)
      tensor(1)
      >>> dglsp.smin(A, 0)
      tensor([1, 0, 2])
      >>> dglsp.smin(A, 1)
      tensor([1, 1, 0, 0])
  
      Case2: vector-valued sparse matrix
  
      >>> indices = torch.tensor([[0, 1, 1], [0, 0, 2]])
      >>> val = torch.tensor([[1, 2], [2, 1], [2, 2]])
      >>> A = dglsp.spmatrix(indices, val, shape=(4, 3))
      >>> dglsp.smin(A)
      tensor([1, 1])
      >>> dglsp.smin(A, 0)
      tensor([[1, 1],
              [0, 0],
              [2, 2]])
      >>> dglsp.smin(A, 1)
      tensor([[1, 2],
              [2, 1],
              [0, 0],
              [0, 0]])
      """
      return torch.ops.dgl_sparse.smin(input.c_sparse_matrix, dim)
  
file_path: dgl/python/dgl/sparse/reduction.py
imports: from typing import Optional
  import torch
  from .sparse_matrix import SparseMatrix
label_desc: Use image node_id 4 for calling a global function with example usage: smin(input, dim) and returns: torch