Table Of Contents
Table Of Contents


mxnet.ndarray.contrib.getnnz(data=None, axis=_Null, out=None, name=None, **kwargs)

Number of stored values for a sparse tensor, including explicit zeros.

This operator only supports CSR matrix on CPU.

Defined in src/operator/contrib/

  • data (NDArray) – Input

  • axis (int or None, optional, default='None') – Select between the number of values across the whole matrix, in each column, or in each row.

  • out (NDArray, optional) – The output NDArray to hold the result.


out – The output of this function.

Return type

NDArray or list of NDArrays