dgl.sparse.SparseMatrix.nnz

property SparseMatrix.nnz: int

返回稀疏矩阵中非零元素的数量。

Returns:

矩阵中非零元素的数量

Return type:

int