ckt624 commented on a change in pull request #15381: [Numpy] Add Documentations
URL: https://github.com/apache/incubator-mxnet/pull/15381#discussion_r298901384
 
 

 ##########
 File path: python/mxnet/numpy/multiarray.py
 ##########
 @@ -1759,22 +1880,45 @@ def swapaxes(a, axis1, axis2):
 
 @set_module('mxnet.numpy')
 def expand_dims(a, axis):
-    """Expand the shape of an array.
-
-    Insert a new axis that will appear at the `axis` position in the expanded 
array shape.
-
+    """
+    Expand the shape of an array.
+    Insert a new axis that will appear at the `axis` position in the expanded
+    array shape.
+    
     Parameters
     ----------
-    a : ndarray
+    a : array_like
         Input array.
     axis : int
         Position in the expanded axes where the new axis is placed.
-
+    
     Returns
     -------
     res : ndarray
         Output array. The number of dimensions is one greater than that of
         the input array.
+    
+    See Also
+    --------
+    squeeze : The inverse operation, removing singleton dimensions
+    reshape : Insert, remove, and combine dimensions, and resize existing ones
+    
+    Examples
+    --------
+    >>> x = np.array([1,2])
+    >>> x.shape
+    (2,)
+    >>> y = np.expand_dims(x, axis=0)
+    >>> y
+    array([[1, 2]])
 
 Review comment:
   Thx. Fixed.

----------------------------------------------------------------
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

Reply via email to