Skip to content

Commit

Permalink
update ndarray.nd, remove invoke from excluded members
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-haibin-lin committed Aug 1, 2017
1 parent 3b94a3c commit d5a7f3f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cub
Submodule cub updated from 80dbf0 to 89de7a
32 changes: 30 additions & 2 deletions docs/api/python/ndarray.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/mxdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions python/mxnet/ndarray/__init__.py
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions python/mxnet/ndarray/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -817,6 +823,8 @@ def dtype(self):

@property
def stype(self):
"""Storage-type of the array.
"""
return _storage_type(self.handle)

@property
Expand Down

0 comments on commit d5a7f3f

Please sign in to comment.