dgl.sparse.DiagMatrix.nnz

property DiagMatrix.nnz

Returns the number of non-zero elements in the diagonal matrix.

Returns

The number of non-zero elements in the diagonal matrix

Return type

int