From f944122dbdfdaf26ce0c036d533dad4ca8d4628b Mon Sep 17 00:00:00 2001 From: eric-haibin-lin Date: Mon, 21 Aug 2017 23:22:11 +0000 Subject: [PATCH 1/2] add clarification for csr --- python/mxnet/ndarray/sparse.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/mxnet/ndarray/sparse.py b/python/mxnet/ndarray/sparse.py index da81b155e4b6..5bbf6f73fbe6 100644 --- a/python/mxnet/ndarray/sparse.py +++ b/python/mxnet/ndarray/sparse.py @@ -247,6 +247,9 @@ class CSRNDArray(BaseSparseNDArray): row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in values[indptr[i]:indptr[i+1]]. + The indices are expected to be sorted per row in ascending order. Duplicate matrix entries are + not allowed. + Example ------- >>> a = mx.nd.array([[0, 1, 0], [2, 0, 0], [0, 0, 0], [0, 0, 3]]) From b0fa268bd5e26804a595fe23b6a48ea0562a961c Mon Sep 17 00:00:00 2001 From: eric-haibin-lin Date: Mon, 21 Aug 2017 23:27:49 +0000 Subject: [PATCH 2/2] cr comments --- python/mxnet/ndarray/sparse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mxnet/ndarray/sparse.py b/python/mxnet/ndarray/sparse.py index 5bbf6f73fbe6..97e43f5ebe79 100644 --- a/python/mxnet/ndarray/sparse.py +++ b/python/mxnet/ndarray/sparse.py @@ -247,8 +247,8 @@ class CSRNDArray(BaseSparseNDArray): row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in values[indptr[i]:indptr[i+1]]. - The indices are expected to be sorted per row in ascending order. Duplicate matrix entries are - not allowed. + The column indices for a given row are expected to be sorted in ascending order. + Duplicate column entries for the same row are not allowed. Example -------