From c756a7107a61bed42813eb48943d452d28d13c77 Mon Sep 17 00:00:00 2001 From: Haibin Lin Date: Thu, 27 Jun 2019 09:12:23 -0700 Subject: [PATCH 1/2] Update sparse_retain.cc --- src/operator/tensor/sparse_retain.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/operator/tensor/sparse_retain.cc b/src/operator/tensor/sparse_retain.cc index 007541b00b37..8a90e8c39a2b 100644 --- a/src/operator/tensor/sparse_retain.cc +++ b/src/operator/tensor/sparse_retain.cc @@ -31,7 +31,7 @@ namespace op { // accepts row-sparse format ndarrays. It will be registered // under mxnet.ndarray.sparse with name retain. NNVM_REGISTER_OP(_sparse_retain) -.describe(R"code(pick rows specified by user input index array from a row sparse matrix +.describe(R"code(Pick rows specified by user input index array from a row sparse matrix and save them in the output sparse matrix. Example:: @@ -42,7 +42,7 @@ Example:: rsp_in = row_sparse(data, indices) to_retain = [0, 3] rsp_out = retain(rsp_in, to_retain) - rsp_out.values = [[1, 2], [5, 6]] + rsp_out.data = [[1, 2], [5, 6]] rsp_out.indices = [0, 3] The storage type of ``retain`` output depends on storage types of inputs From 1e3cee0da8b4b0d92e46ddca534d1052a22ab302 Mon Sep 17 00:00:00 2001 From: Haibin Lin Date: Thu, 27 Jun 2019 11:14:50 -0700 Subject: [PATCH 2/2] Update sparse_retain.cc --- src/operator/tensor/sparse_retain.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operator/tensor/sparse_retain.cc b/src/operator/tensor/sparse_retain.cc index 8a90e8c39a2b..b1f38c6d13b1 100644 --- a/src/operator/tensor/sparse_retain.cc +++ b/src/operator/tensor/sparse_retain.cc @@ -39,7 +39,7 @@ Example:: data = [[1, 2], [3, 4], [5, 6]] indices = [0, 1, 3] shape = (4, 2) - rsp_in = row_sparse(data, indices) + rsp_in = row_sparse_array(data, indices) to_retain = [0, 3] rsp_out = retain(rsp_in, to_retain) rsp_out.data = [[1, 2], [5, 6]]