Skip to content

Commit

Permalink
Fix Sphinx python docstrings (apache#13160)
Browse files Browse the repository at this point in the history
* Doc fixes

* addressing feedback

* base_module fix

* fixing cross-reference issues
  • Loading branch information
Roshrini authored and azai91 committed Dec 1, 2018
1 parent 82855bf commit 6973868
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 109 deletions.
2 changes: 1 addition & 1 deletion docs/api/python/ndarray/sparse.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ We summarize the interface for each class in the following sections.
:members: shape, context, dtype, stype, data, indices, indptr, copy, copyto, as_in_context, asscipy, asnumpy, asscalar, astype, tostype, slice, wait_to_read, zeros_like, round, rint, fix, floor, ceil, trunc, sin, tan, arcsin, arctan, degrees, radians, sinh, tanh, arcsinh, arctanh, expm1, log1p, sqrt, square, __neg__, sum, mean, norm, square, __getitem__, __setitem__, check_format, abs, clip, sign
.. autoclass:: mxnet.ndarray.sparse.RowSparseNDArray
:members: shape, context, dtype, stype, data, indices, copy, copyto, as_in_context, asnumpy, asscalar, astype, tostype, wait_to_read, zeros_like, round, rint, fix, floor, ceil, trunc, sin, tan, arcsin, arctan, degrees, radians, sinh, tanh, arcsinh, arctanh, expm1, log1p, sqrt, square, __negative__, norm, __getitem__, __setitem__, check_format, retain, abs, clip, sign
:members: shape, context, dtype, stype, data, indices, copy, copyto, as_in_context, asnumpy, asscalar, astype, tostype, wait_to_read, zeros_like, round, rint, fix, floor, ceil, trunc, sin, tan, arcsin, arctan, degrees, radians, sinh, tanh, arcsinh, arctanh, expm1, log1p, sqrt, square, norm, __getitem__, __setitem__, check_format, retain, abs, clip, sign
.. automodule:: mxnet.ndarray.sparse
:members:
Expand Down
14 changes: 7 additions & 7 deletions python/mxnet/gluon/model_zoo/vision/mobilenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _add_conv_dw(out, dw_channels, channels, stride, relu6=False):
class LinearBottleneck(nn.HybridBlock):
r"""LinearBottleneck used in MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -138,7 +138,7 @@ def hybrid_forward(self, F, x):
class MobileNetV2(nn.HybridBlock):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -223,7 +223,7 @@ def get_mobilenet_v2(multiplier, pretrained=False, ctx=cpu(),
root=os.path.join(base.data_dir(), 'models'), **kwargs):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -269,7 +269,7 @@ def mobilenet1_0(**kwargs):
def mobilenet_v2_1_0(**kwargs):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -300,7 +300,7 @@ def mobilenet0_75(**kwargs):
def mobilenet_v2_0_75(**kwargs):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -331,7 +331,7 @@ def mobilenet0_5(**kwargs):
def mobilenet_v2_0_5(**kwargs):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down Expand Up @@ -362,7 +362,7 @@ def mobilenet0_25(**kwargs):
def mobilenet_v2_0_25(**kwargs):
r"""MobileNetV2 model from the
`"Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation"
Mobile Networks for Classification, Detection and Segmentation"
<https://arxiv.org/abs/1801.04381>`_ paper.
Parameters
Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/module/base_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def score(self, eval_data, eval_metric, num_batch=None, batch_end_callback=None,
def iter_predict(self, eval_data, num_batch=None, reset=True, sparse_row_id_fn=None):
"""Iterates over predictions.
Example Usage:
----------
Examples
--------
>>> for pred, i_batch, batch in module.iter_predict(eval_data):
... # pred is a list of outputs from the module
... # i_batch is a integer
Expand Down
68 changes: 34 additions & 34 deletions python/mxnet/ndarray/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def __setitem__(self, key, value):
Parameters
----------
key : int, slice, list, np.ndarray, NDArray, or tuple of all previous types
key : int, mxnet.ndarray.slice, list, np.ndarray, NDArray, or tuple of all previous types
The indexing key.
value : scalar or array-like object that can be broadcast to the shape of self[key]
The value to set.
Expand Down Expand Up @@ -467,7 +467,7 @@ def __getitem__(self, key):
Parameters
----------
key : int, slice, list, np.ndarray, NDArray, or tuple of all previous types
key : int, mxnet.ndarray.slice, list, np.ndarray, NDArray, or tuple of all previous types
Indexing key.
Examples
Expand Down Expand Up @@ -2642,9 +2642,9 @@ def add(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be added.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be added.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -2704,9 +2704,9 @@ def subtract(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be subtracted.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be subtracted.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -2765,9 +2765,9 @@ def multiply(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be multiplied.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be multiplied.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -2826,9 +2826,9 @@ def divide(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array in division.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array in division.
The arrays to be divided. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -2883,9 +2883,9 @@ def modulo(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array in modulo.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array in modulo.
The arrays to be taken modulo. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3002,9 +3002,9 @@ def maximum(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3059,9 +3059,9 @@ def minimum(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3120,9 +3120,9 @@ def equal(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3184,9 +3184,9 @@ def not_equal(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3251,9 +3251,9 @@ def greater(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3315,9 +3315,9 @@ def greater_equal(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3379,9 +3379,9 @@ def lesser(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3443,9 +3443,9 @@ def lesser_equal(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First array to be compared.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second array to be compared. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3506,9 +3506,9 @@ def logical_and(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First input of the function.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second input of the function. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3566,9 +3566,9 @@ def logical_or(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First input of the function.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second input of the function. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -3626,9 +3626,9 @@ def logical_xor(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.array
First input of the function.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.array
Second input of the function. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down
18 changes: 9 additions & 9 deletions python/mxnet/ndarray/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def __setitem__(self, key, value):
if isinstance(key, py_slice):
if key.step is not None or key.start is not None or key.stop is not None:
raise ValueError('Assignment with slice for CSRNDArray is not ' \
'implmented yet.')
'implemented yet.')
if isinstance(value, NDArray):
# avoid copying to itself
if value.handle is not self.handle:
Expand Down Expand Up @@ -1205,9 +1205,9 @@ def add(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.sparse.array
First array to be added.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.sparse.array
Second array to be added.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -1277,9 +1277,9 @@ def subtract(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.sparse.array
First array to be subtracted.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.sparse.array
Second array to be subtracted.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.__spec__
Expand Down Expand Up @@ -1348,9 +1348,9 @@ def multiply(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.sparse.array
First array to be multiplied.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.sparse.array
Second array to be multiplied.
If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down Expand Up @@ -1432,9 +1432,9 @@ def divide(lhs, rhs):
Parameters
----------
lhs : scalar or array
lhs : scalar or mxnet.ndarray.sparse.array
First array in division.
rhs : scalar or array
rhs : scalar or mxnet.ndarray.sparse.array
Second array in division.
The arrays to be divided. If ``lhs.shape != rhs.shape``, they must be
broadcastable to a common shape.
Expand Down
Loading

0 comments on commit 6973868

Please sign in to comment.