class_docstr: Sparse matrix with DIAgonal storage.
  
  Now it has only one initializer format below:
  
  ``dia_matrix((data, offsets))``
  
  Args:
      arg1: Arguments for the initializer.
      shape (tuple): Shape of a matrix. Its length must be two.
      dtype: Data type. It must be an argument of :class:`numpy.dtype`.
      copy (bool): If ``True``, copies of given arrays are always used.
  
  .. seealso::
     :class:`scipy.sparse.dia_matrix`
class_docstr_tok: ["Sparse","matrix","with","DIAgonal","storage",".","Now","it","has","only","one","initializer","format","below",":","``","dia_matrix","(","(","data",",","offsets",")",")","``","Args",":","arg1",":","Arguments","for","the","initializer",".","shape","(","tuple",")",":","Shape","of","a","matrix",".","Its","length","must","be","two",".","dtype",":","Data","type",".","It","must","be","an","argument","of",":","class",":","`","numpy.dtype","`",".","copy","(","bool",")",":","If","``","True","``",",","copies","of","given","arrays","are","always","used",".","..","seealso",":",":",":","class",":","`","scipy.sparse.dia_matrix","`"]
docstr: Returns the number of stored values, including explicit zeros.
  
  Args:
      axis: Not supported yet.
  
  Returns:
      int: The number of stored values.
docstr_tok: ["Returns","the","number","of","stored","values",",","including","explicit","zeros",".","Args",":","axis",":","Not","supported","yet",".","Returns",":","int",":","The","number","of","stored","values","."]
code: def getnnz(self, axis=None):
      """Returns the number of stored values, including explicit zeros.
  
      Args:
          axis: Not supported yet.
  
      Returns:
          int: The number of stored values.
  
      """
      if axis is not None:
          raise NotImplementedError(
              "getnnz over an axis is not implemented for DIA format"
          )
  
      m, n = self.shape
      nnz = _core.ReductionKernel(
          "int32 offsets, int32 m, int32 n",
          "int32 nnz",
          "offsets > 0 ? min(m, n - offsets) : min(m + offsets, n)",
          "a + b",
          "nnz = a",
          "0",
          "dia_nnz",
      )(self.offsets, m, n)
      return int(nnz)
  
file_path: cupy/cupyx/scipy/sparse/_dia.py
imports: import cupy
  from cupy import _core
  from cupyx.scipy.sparse import _csc
  from cupyx.scipy.sparse import _data
  from cupyx.scipy.sparse import _util
label_desc: Use image node_id 5 for calling the dia_matrix obj's underlying member method code with example usage: obj.getnnz(axis) and returns: int