From d5a7f3fc514203c71003a233747569cab6147e58 Mon Sep 17 00:00:00 2001 From: eric-haibin-lin Date: Tue, 1 Aug 2017 05:31:41 +0000 Subject: [PATCH] update ndarray.nd, remove `invoke` from excluded members --- cub | 2 +- dlpack | 2 +- docs/api/python/ndarray.md | 32 ++++++++++++++++++++++++++++++-- docs/mxdoc.py | 4 ++-- python/mxnet/ndarray/__init__.py | 8 +++----- python/mxnet/ndarray/ndarray.py | 8 ++++++++ 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/cub b/cub index 80dbf02aa36d..89de7ab20167 160000 --- a/cub +++ b/cub @@ -1 +1 @@ -Subproject commit 80dbf02aa36d9ef881629e2ee2c15415ba07cef5 +Subproject commit 89de7ab20167909bc2c4f8acd397671c47cf3c0d diff --git a/dlpack b/dlpack index a6e09b58dc00..36e573893fc3 160000 --- a/dlpack +++ b/dlpack @@ -1 +1 @@ -Subproject commit a6e09b58dc00ee0065f5b7879800e646fbb01d1e +Subproject commit 36e573893fc39d324ccf2f2962300da6da5898a2 diff --git a/docs/api/python/ndarray.md b/docs/api/python/ndarray.md index a782b910e656..c78708dce76b 100644 --- a/docs/api/python/ndarray.md +++ b/docs/api/python/ndarray.md @@ -64,9 +64,22 @@ A detailed tutorial is available at ``` In the rest of this document, we first overview the methods provided by the -`ndarray.NDArray` class, and then list other routines provided by the -`ndarray` package. +`ndarray.NDArray` class and its subclasses, and then list other routines +provided by the `ndarray` package. +The `ndarray` package provides several classes: + +```eval_rst +.. autosummary:: + :nosignatures: + + NDArray + SparseNDArray + CSRNDArray + RowSparseNDArray +``` + +We summarize the interface for each class in the following sections. ## The `NDArray` class @@ -80,6 +93,7 @@ In the rest of this document, we first overview the methods provided by the NDArray.size NDArray.context NDArray.dtype + NDArray.stype ``` ### Array conversion @@ -171,6 +185,17 @@ In the rest of this document, we first overview the methods provided by the NDArray.wait_to_read ``` +## Class `SparseNDArrayBase` + +```eval_rst +.. autosummary:: + :nosignatures: + + SparseNDArray.copyto + SparseNDArray.__setitem__ + SparseNDArray.__getitem__ +``` + ## Array creation routines ```eval_rst @@ -470,6 +495,9 @@ In the rest of this document, we first overview the methods provided by the ```eval_rst .. automodule:: mxnet.ndarray :members: + :imported-members: + :special-members: + :exclude-members: CachedOp .. automodule:: mxnet.random :members: diff --git a/docs/mxdoc.py b/docs/mxdoc.py index 25f6af779ef6..e1990508c980 100644 --- a/docs/mxdoc.py +++ b/docs/mxdoc.py @@ -6,7 +6,7 @@ import sys from recommonmark import transform import pypandoc -import StringIO +from io import StringIO import contextlib # white list to evaluate the code block output, such as ['tutorials/gluon'] @@ -345,7 +345,7 @@ def add_buttons(app, docname, source): def setup(app): app.connect("builder-inited", build_mxnet) app.connect("builder-inited", generate_doxygen) - app.connect("builder-inited", build_scala_docs) + #app.connect("builder-inited", build_scala_docs) # skipped to build r, it requires to install latex, which is kinds of too heavy # app.connect("builder-inited", build_r_docs) app.connect('source-read', convert_table) diff --git a/python/mxnet/ndarray/__init__.py b/python/mxnet/ndarray/__init__.py index f9e935b76d25..f2d091ee354b 100644 --- a/python/mxnet/ndarray/__init__.py +++ b/python/mxnet/ndarray/__init__.py @@ -1,12 +1,10 @@ -"""ndarray module""" +"""NDArray API of MXNet.""" from . import _internal from . import op from .op import CachedOp -from .ndarray import NDArray, array, concatenate, _DTYPE_NP_TO_MX, _DTYPE_MX_TO_NP -from .ndarray import empty, ones, add, arange, divide, equal, full, greater, greater_equal, imdecode -from .ndarray import lesser, lesser_equal, maximum, minimum, moveaxis, multiply, negative, not_equal -from .ndarray import onehot_encode, power, subtract, true_divide, waitall, _new_empty_handle +# pylint: disable=wildcard-import +from .ndarray import * from .ndarray_utils import load, save, zeros from .sparse_ndarray import _ndarray_cls from .sparse_ndarray import csr, row_sparse, SparseNDArray, todense, RowSparseNDArray, CSRNDArray diff --git a/python/mxnet/ndarray/ndarray.py b/python/mxnet/ndarray/ndarray.py index c45cefaedbc0..7108a8144809 100644 --- a/python/mxnet/ndarray/ndarray.py +++ b/python/mxnet/ndarray/ndarray.py @@ -26,6 +26,12 @@ from . import broadcast_greater, broadcast_greater_equal, broadcast_lesser, broadcast_lesser_equal from . import zeros_like, slice +__all__ = ["NDArray", "array", "concatenate", "_DTYPE_NP_TO_MX", "_DTYPE_MX_TO_NP", "empty", \ + "ones", "add", "arange", "divide", "equal", "full", "greater", "greater_equal", \ + "imdecode", "lesser", "lesser_equal", "maximum", "minimum", "moveaxis", \ + "multiply", "negative", "not_equal", "onehot_encode", "power", "subtract", \ + "true_divide", "waitall", "_new_empty_handle"] + # pylint: disable= no-member _DTYPE_NP_TO_MX = { None : -1, @@ -817,6 +823,8 @@ def dtype(self): @property def stype(self): + """Storage-type of the array. + """ return _storage_type(self.handle) @property