ChaiBapchya commented on a change in pull request #14243: Fix commands to make
doc consistent
URL: https://github.com/apache/incubator-mxnet/pull/14243#discussion_r274088680
##########
File path: python/mxnet/ndarray_doc.py
##########
@@ -54,6 +54,267 @@ class ReshapeDoc(NDArrayDoc):
(4L, 3L, 2L)
"""
+class ConcatDoc(NDArrayDoc):
+ """
+ Examples
+ --------
+ Joins input arrays along a given axis.
+ >>> x = mx.nd.array([[1,1],[2,2]])
+ >>> y = mx.nd.array([[3,3],[4,4],[5,5]])
+ >>> z = mx.nd.array([[6,6], [7,7],[8,8]])
+
+ >>> mx.nd.concat(x,y,z,dim=0)
+ [[1. 1.]
+ [2. 2.]
+ [3. 3.]
+ [4. 4.]
+ [5. 5.]
+ [6. 6.]
+ [7. 7.]
+ [8. 8.]]
+ <NDArray 8x2 @cpu(0)>
+
+ >>> mx.nd.concat(y,z,dim=1)
+ [[3. 3. 6. 6.]
+ [4. 4. 7. 7.]
+ [5. 5. 8. 8.]]
+ <NDArray 3x4 @cpu(0)>
+ """
+
+class SwapAxisDoc(NDArrayDoc):
+ """
+ Examples
+ --------
+ Interchanges two axes of an array.
+ >>> x = mx.nd.array([[1, 2, 3]])
+ >>> mx.nd.swapaxes(x, 0, 1)
+ [[1.]
+ [2.]
+ [3.]]
+
+ >>> x = mx.nd.array([[[ 0, 1],[ 2, 3]],[[ 4, 5],[ 6, 7]]])
+ >>> x
+ [[[0. 1.]
+ [2. 3.]]
+ [[4. 5.]
+ [6. 7.]]]
+ <NDArray 2x2x2 @cpu(0)>
+ >>> mx.nd.swapaxes(x, 0, 2)
+ [[[0. 4.]
+ [2. 6.]]
+ [[1. 5.]
+ [3. 7.]]]
+ <NDArray 2x2x2 @cpu(0)>
+ """
+
+class whereDoc(NDArrayDoc):
+ """
+ Examples
+ --------
+ Return the elements, either from x or y, depending on the condition.
+ >>> x = mx.nd.array([[1, 2], [3, 4]])
+ >>> y = mx.nd.array([[5, 6], [7, 8]])
+
+ >>> cond = mx.nd.array([[0, 1], [-1, 0]])
+ >>> mx.nd.where(cond, x, y)
+ [[5. 2.]
+ [3. 8.]]
+ <NDArray 2x2 @cpu(0)>
+
+ >>> csr_cond = mx.nd.sparse.cast_storage(cond, 'csr')
+ >>> mx.nd.sparse.where(csr_cond, x, y)
+ [[5. 2.]
+ [3. 8.]]
+ <NDArray 2x2 @cpu(0)>
+ """
+
+class ReshapeLikeDoc(NDArrayDoc):
Review comment:
I was actually confused. Originally, there were 2 variants
Capitalized - StackDoc, BroadcastToDoc, ReshapeDoc
Non-capitalized - elemwise_addDoc
I am not sure if I understood the difference. Any help on those lines would
be great. Thanks for pointing out.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services