Skip to content

Commit

Permalink
Fix minor issues with api pages. (apache#6410)
Browse files Browse the repository at this point in the history
1. In the notes section for ndarray, references did not seem clear enough to be referring to mxnet.ndarray or numpy.ndarray. Added the package names as prefixes to make it more obvious.
2. "share the same C++ operator source codes" => "share the same code". Since we don't really need to throw in more details than required.
3. Other relatively  minor language changes which will be obvious from the diff.

Note that I'm relatively not sure about the need for 1/ since it makes things more verbose. Let me know if it unnecessary and I'll remove it.
  • Loading branch information
pracheer authored and Olivier committed May 30, 2017
1 parent f58b5b4 commit 9d3db06
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/api/python/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MXNet - Python API

MXNet provides a rich Python API to serve a broad community of Python developers.
In this section, we provide a in-depth discussion of the functionality provided by
In this section, we provide an in-depth discussion of the functionality provided by
various MXNet Python packages. We have included code samples for most of the APIs
for improved clarity. These code samples will run as-is as long as MXNet is first
imported by running:
Expand Down
32 changes: 17 additions & 15 deletions docs/api/python/ndarray.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Overview

This document lists the routines of the *n*-dimensional array package
This document lists the routines of the *n*-dimensional array package:

```eval_rst
.. autosummary::
Expand All @@ -17,7 +17,7 @@ This document lists the routines of the *n*-dimensional array package

The `NDArray` API, defined in the `ndarray` (or simply `nd`) package, provides
imperative tensor operations on CPU/GPU.
A `NDArray` represents a multidimensional, fixed-size homogenous array.
An `NDArray` represents a multi-dimensional, fixed-size homogenous array.

```python
>>> x = mx.nd.array([[1, 2, 3], [4, 5, 6]])
Expand All @@ -36,29 +36,31 @@ A `NDArray` represents a multidimensional, fixed-size homogenous array.

A detailed tutorial is available at
[NDArray - Imperative tensor operations on CPU/GPU](http://mxnet.io/tutorials/basic/ndarray.html).
<br><br>

```eval_rst
.. note:: ``mxnet.ndarray`` is similar to ``numpy.ndarray`` in some aspects. But the difference is not negligible. For example
.. note:: ``mxnet.ndarray`` is similar to ``numpy.ndarray`` in some aspects. But the differences are not negligible. For instance:
- ``NDArray.T`` does real data transpose to return new a copied array, instead
of returning a view of the input array.
- ``ndarray.dot`` performs dot between the last axis of the first input array
and the first axis of the second input, while `numpy.dot` uses the second
last axis of the input array.
- ``mxnet.ndarray.NDArray.T`` does real data transpose to return new a copied
array, instead of returning a view of the input array.
- ``mxnet.ndarray.dot`` performs dot product between the last axis of the
first input array and the first axis of the second input, while `numpy.dot`
uses the second last axis of the input array.
In additional, ``NDArray`` supports GPU computation and various neural
In addition, ``mxnet.ndarray.NDArray`` supports GPU computation and various neural
network layers.
.. note:: ``ndarray`` also provides almost same routines to ``symbol``. Most
routines between these two packages share the same C++ operator source
codes. But ``ndarray`` differs to ``symbol`` in several aspects:
.. note:: ``ndarray`` provides almost the same routines as ``symbol``. Most
routines between these two packages share the source code. But ``ndarray``
differs from ``symbol`` in few aspects:
- ``ndarray`` adopts imperative programming, namely sentences are executed
step-by-step so that the results can be obtained immediately.
step-by-step so that the results can be obtained immediately whereas
``symbol`` adopts declarative programming.
- Most binary operators such as ``+`` and ``>`` are enabled broadcasting in
default.
- Most binary operators in ``ndarray`` such as ``+`` and ``>`` have
broadcasting enabled by default.
```

In the rest of this document, we first overview the methods provided by the
Expand Down
13 changes: 7 additions & 6 deletions docs/api/python/symbol.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ array([ 4., 7.], dtype=float32)
```

A detailed tutorial is available at [Symbol - Neural network graphs and auto-differentiation](http://mxnet.io/tutorials/basic/symbol.html).
<br><br>

```eval_rst
.. note:: most operators provided in ``symbol`` are similar to ``ndarray``. But
also note that ``symbol`` differs to ``ndarray`` in several aspects:
.. note:: most operators provided in ``symbol`` are similar to those in ``ndarray``
although there are few differences:
- ``symbol`` adopts declarative programming. In other words, we need to first
composite the computations, and then feed with data to execute.
compose the computations, and then feed it with data for execution whereas
ndarray adopts imperative programming.
- Most binary operators such as ``+`` and ``>`` are not enabled broadcasting.
We need to call the broadcasted version such as ``broadcast_plus``
- Most binary operators in ``symbol`` such as ``+`` and ``>`` don't broadcast.
We need to call the broadcast version of the operator such as ``broadcast_plus``
explicitly.
```

In the rest of this document, we first overview the methods provided by the
Expand Down

0 comments on commit 9d3db06

Please sign in to comment.